mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-10 03:21:30 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45deb2c218 | ||
|
|
1194b29c12 | ||
|
|
b56551e978 | ||
|
|
32c2ae8278 | ||
|
|
a723a833a8 | ||
|
|
c78a0da045 | ||
|
|
bf122a33e6 | ||
|
|
3734ccbcc0 | ||
|
|
362b76fd74 | ||
|
|
e968dd85e2 | ||
|
|
d51b32f662 | ||
|
|
4e78375340 | ||
|
|
1bab26dc3d | ||
|
|
f678a06b95 | ||
|
|
682775ba83 | ||
|
|
24c798f550 | ||
|
|
73c853def4 | ||
|
|
38600f4cf3 | ||
|
|
3cfde6cc45 | ||
|
|
1c8d147d7c | ||
|
|
37d12c3859 | ||
|
|
8283092367 | ||
|
|
ed7c3dcff4 | ||
|
|
836fb17d0d | ||
|
|
564eb6a4a0 | ||
|
|
969ed176d6 | ||
|
|
8e2be92c72 | ||
|
|
f9d9dc8adb | ||
|
|
a127d2bf48 | ||
|
|
5fca67974d | ||
|
|
02c35441d6 | ||
|
|
10d652a9f7 | ||
|
|
77069b7299 | ||
|
|
e34fdedfb4 | ||
|
|
dea603dcc1 | ||
|
|
011078f991 | ||
|
|
d0442f4468 | ||
|
|
615c581cd2 | ||
|
|
fd75ae487e | ||
|
|
c2c3ed6a76 | ||
|
|
4ac264b1d0 | ||
|
|
65935696c3 | ||
|
|
4d9fb951df | ||
|
|
836aa69f9c | ||
|
|
253f770259 | ||
|
|
50fbf04df5 | ||
|
|
55d123d95a | ||
|
|
7fee4ad11b | ||
|
|
14308e0b98 | ||
|
|
6b93b77d0d | ||
|
|
70fd455b13 | ||
|
|
839747f420 | ||
|
|
d1a74e1b96 | ||
|
|
89e9bdc413 | ||
|
|
87d0bce799 | ||
|
|
b29fbbb587 | ||
|
|
f983519589 | ||
|
|
4fbf823707 | ||
|
|
26b0bc771d | ||
|
|
0eff23eeed | ||
|
|
97f0357407 | ||
|
|
92272fe01e | ||
|
|
52c73e6382 | ||
|
|
b26a031ca8 | ||
|
|
5309036463 | ||
|
|
ca78e1c2bf | ||
|
|
5340387164 | ||
|
|
912fb252c6 | ||
|
|
1907deb8de | ||
|
|
042783af21 | ||
|
|
7bed40d17b | ||
|
|
ff726d212c | ||
|
|
d6d0bb5e4e | ||
|
|
2fe4cf6ca5 | ||
|
|
ef0eba5c5f | ||
|
|
77d185ba8b | ||
|
|
e47e055508 | ||
|
|
7afbd4632d | ||
|
|
cb576b1b95 | ||
|
|
778571e3d0 | ||
|
|
9144583fdb | ||
|
|
e394b439a8 | ||
|
|
b12d1d7d8a | ||
|
|
c41e2218f7 | ||
|
|
f7dba5d331 | ||
|
|
4dcd7a0247 | ||
|
|
956d08e9bc | ||
|
|
9fe72bfa7b | ||
|
|
b6eb048a12 | ||
|
|
875ff0e28c | ||
|
|
2b415292c6 | ||
|
|
0f55f8f12b | ||
|
|
a02245ade2 | ||
|
|
f0bfdbf209 | ||
|
|
2d769d4bfb | ||
|
|
64dc3dde40 | ||
|
|
385dfdd33d | ||
|
|
777b0a33c3 | ||
|
|
f8f29fbccf | ||
|
|
fb6a2ef746 | ||
|
|
7969221919 | ||
|
|
918b0619d0 | ||
|
|
0da68dacf5 | ||
|
|
4cf27651ba | ||
|
|
7e9e330e99 | ||
|
|
7175c3ec22 | ||
|
|
221df13250 | ||
|
|
7b4c4efd11 | ||
|
|
d18ae6dac6 | ||
|
|
b6e6b78843 | ||
|
|
eed65a64b2 | ||
|
|
908974dfe4 | ||
|
|
904f0e65e5 | ||
|
|
51722b628c | ||
|
|
28ab397d60 | ||
|
|
8a06263ba6 | ||
|
|
811138221a | ||
|
|
daa30b1dc8 | ||
|
|
d2ec1ba2cc | ||
|
|
6467d24070 | ||
|
|
eebe0eda48 | ||
|
|
419eb5a6c0 | ||
|
|
0cd1843bc2 | ||
|
|
8066a6938f | ||
|
|
16a5a69bae | ||
|
|
eed44eea9c | ||
|
|
1788042c9e | ||
|
|
bf95fa34da | ||
|
|
32f7d73835 | ||
|
|
88e56faafa | ||
|
|
1df3e20bdd | ||
|
|
6a5af218c7 | ||
|
|
b3316fea35 | ||
|
|
db030f6472 | ||
|
|
c48ccdb1fc | ||
|
|
9ea18c433b | ||
|
|
453781af9c | ||
|
|
a529b7b487 | ||
|
|
690670e2b5 | ||
|
|
5351b56a0b | ||
|
|
b757304513 | ||
|
|
cc0ce43a57 | ||
|
|
5904839bc6 | ||
|
|
fffc7597fd | ||
|
|
4a7dfba6ee | ||
|
|
addc75748b | ||
|
|
ece9851afb | ||
|
|
2e480a37ea | ||
|
|
890e076d20 | ||
|
|
547f8968aa | ||
|
|
b0b3abe775 | ||
|
|
27d2877106 | ||
|
|
897488862e | ||
|
|
0212567d75 | ||
|
|
109adf9739 | ||
|
|
ca2a4cdb27 | ||
|
|
3057c31798 | ||
|
|
0a123e8215 | ||
|
|
1eaf6f54cc | ||
|
|
9be6d265b4 | ||
|
|
8fff917341 | ||
|
|
adc3c9e36b | ||
|
|
da06dfca0d | ||
|
|
030231038c | ||
|
|
38fe58e746 | ||
|
|
b80b9cd157 | ||
|
|
8a68c620ac | ||
|
|
4b73879369 | ||
|
|
1ab81e5711 | ||
|
|
999887bda5 | ||
|
|
b9a08520ff | ||
|
|
1da7baa49d | ||
|
|
1b8093513d | ||
|
|
2061b465fb | ||
|
|
6dd46e6971 | ||
|
|
6ac8b89601 | ||
|
|
4b586b6496 | ||
|
|
e8bd94aab8 | ||
|
|
b5cf9b639e | ||
|
|
91caf28bfc | ||
|
|
2409831a14 | ||
|
|
bc52b952d7 | ||
|
|
4428b545bb | ||
|
|
fdf3a07b15 | ||
|
|
c8c5b69b5e | ||
|
|
473400902c | ||
|
|
58ad81f063 | ||
|
|
b01149f068 | ||
|
|
89ae74fba6 | ||
|
|
a1f2c6197f | ||
|
|
f4467d6595 | ||
|
|
688d1ef81c | ||
|
|
4f2ed12e4f | ||
|
|
ef710442f1 | ||
|
|
2bd71b55bc | ||
|
|
c78dcbd382 | ||
|
|
80b62fc635 | ||
|
|
7d466c8177 | ||
|
|
516bace3ca | ||
|
|
3307e65ad3 | ||
|
|
01dc71f598 | ||
|
|
17fb07cb85 | ||
|
|
85d9eeb50d | ||
|
|
0314921434 | ||
|
|
dde7c28730 | ||
|
|
682b403a9c | ||
|
|
08d3fe8c04 | ||
|
|
82259a086e | ||
|
|
d045484788 | ||
|
|
dd522cdc6f | ||
|
|
ae7d956341 | ||
|
|
b94b9e2adb | ||
|
|
621c79dd3c | ||
|
|
21a2ba3f79 | ||
|
|
579c41535a | ||
|
|
107b5eec44 | ||
|
|
882a66b49a | ||
|
|
b4e1ca8a2c | ||
|
|
f309c85f92 | ||
|
|
db723df879 | ||
|
|
5f87fa1aca | ||
|
|
f33264f7a6 | ||
|
|
c5b3428408 | ||
|
|
efdc07ab10 | ||
|
|
920a20f060 | ||
|
|
2414224df8 | ||
|
|
511f43d5cf | ||
|
|
a6ec5a9831 | ||
|
|
6fe4559b8e | ||
|
|
83f1b28f98 | ||
|
|
4f564360e7 | ||
|
|
1ddd7ee79d | ||
|
|
23bb1414ff | ||
|
|
ad1fb29092 | ||
|
|
6a9feb7978 | ||
|
|
ae21bd98aa | ||
|
|
eadfb1398a | ||
|
|
bbb2bda20a | ||
|
|
4e155dbc8e | ||
|
|
9f0f53b1d7 | ||
|
|
fbb8a9640c | ||
|
|
2135e86fc7 | ||
|
|
69a38f9b9f | ||
|
|
c7fd375120 | ||
|
|
464df18ac2 | ||
|
|
3a39a51f11 | ||
|
|
c2b26a3cd9 | ||
|
|
ed29c6f59c | ||
|
|
a855447d11 | ||
|
|
111d666f85 | ||
|
|
d356f88fb5 | ||
|
|
03bddff8e6 | ||
|
|
ccc2bea0c4 | ||
|
|
c1504555ac | ||
|
|
08393b1d0c | ||
|
|
2fca06c994 | ||
|
|
f4feda6323 | ||
|
|
c5750da85a | ||
|
|
c81d363a6e | ||
|
|
302e2fdc53 | ||
|
|
f65e005d97 | ||
|
|
7cfd996802 | ||
|
|
1ed38ddb2d | ||
|
|
6d8bc91220 | ||
|
|
2f0a5f48aa | ||
|
|
3b057d9605 | ||
|
|
76f4cf5cc5 | ||
|
|
99a3aa8ee1 | ||
|
|
73c63d8768 | ||
|
|
3da84396b6 | ||
|
|
2e9a793519 | ||
|
|
bcb7e14d0f | ||
|
|
42818a2310 | ||
|
|
eb72a2e7d2 | ||
|
|
dacf9e327a | ||
|
|
2a8798b729 | ||
|
|
2892abf155 | ||
|
|
3bd585a94e | ||
|
|
2d4236882f | ||
|
|
ec4bfd7827 | ||
|
|
7173efe10f | ||
|
|
43000d2e24 | ||
|
|
db624a7c99 | ||
|
|
72a9d77638 | ||
|
|
36e5909057 | ||
|
|
8655038601 | ||
|
|
9250f649db | ||
|
|
71cc43651a | ||
|
|
e7eb0e2b3e | ||
|
|
33353d5cd9 | ||
|
|
1149487fbd | ||
|
|
f192e8618f | ||
|
|
4eac009c27 | ||
|
|
15470596ad | ||
|
|
f4c6b06b49 | ||
|
|
1d621c412c | ||
|
|
7dc2ca425f | ||
|
|
1075522147 | ||
|
|
9a5b8f0475 | ||
|
|
bd39d72acd | ||
|
|
b582f1c7c6 | ||
|
|
1027762db5 | ||
|
|
ab515daa0c | ||
|
|
3a61cfe6ec | ||
|
|
d09362ed6f | ||
|
|
6eaf19533b | ||
|
|
8f8a9863ad | ||
|
|
c186747edc | ||
|
|
922680851a | ||
|
|
3fbeb0617b | ||
|
|
306d7f6f8a | ||
|
|
ab60005cdc | ||
|
|
f663c64cd4 | ||
|
|
a9ef8333eb | ||
|
|
6d89bbfe61 | ||
|
|
b0a8f5d775 | ||
|
|
ed77d46cc9 | ||
|
|
1ced1b3f73 | ||
|
|
698387e762 | ||
|
|
8928052863 | ||
|
|
8fa6230426 | ||
|
|
7dd3939a26 | ||
|
|
b28c405377 | ||
|
|
b6a6127509 | ||
|
|
7d58bb9799 | ||
|
|
65aa939296 | ||
|
|
c3c4638b22 | ||
|
|
a36d5926d7 | ||
|
|
6f6b1a8333 | ||
|
|
861262ef3a | ||
|
|
c7c7d0988e | ||
|
|
712547cb2b | ||
|
|
5024b77492 | ||
|
|
d01ae6929d | ||
|
|
c2cad1f122 | ||
|
|
25f232616b | ||
|
|
4ea493c86c | ||
|
|
d526530167 | ||
|
|
ae6e2f5df5 | ||
|
|
4354ad296d | ||
|
|
86839db417 | ||
|
|
b9e8e95498 | ||
|
|
150f4f0f4b | ||
|
|
66794d2166 | ||
|
|
81ec152f10 | ||
|
|
60574f04d2 | ||
|
|
419fe62da8 | ||
|
|
aacc544300 | ||
|
|
9fd4ff7a8d | ||
|
|
352be447df | ||
|
|
5ba77289d9 | ||
|
|
497868ecaf | ||
|
|
ef216d3010 | ||
|
|
d2add47f1e | ||
|
|
f45a1d797e | ||
|
|
80311970cf | ||
|
|
1040d3eedf | ||
|
|
07c6b4c363 | ||
|
|
454b4ea715 | ||
|
|
7c2d2246fe | ||
|
|
725430994d | ||
|
|
ea7e682253 | ||
|
|
97d2be1ff3 | ||
|
|
d38dfa60f6 | ||
|
|
b179dde1e7 | ||
|
|
4c7beacfe4 | ||
|
|
b7fe19b6c8 | ||
|
|
744fac6777 | ||
|
|
f0adf90ec0 | ||
|
|
70b573c951 | ||
|
|
e1a7b82b2e | ||
|
|
c24caa8f48 | ||
|
|
753be84ae0 | ||
|
|
27ada9b7b2 | ||
|
|
785ed87117 | ||
|
|
85f07b6f27 | ||
|
|
f004666674 | ||
|
|
eb012a353a | ||
|
|
c645d43598 | ||
|
|
ef3c83da04 | ||
|
|
a0fd9d21d2 | ||
|
|
f6d1cbe6b9 | ||
|
|
ac5c03c458 | ||
|
|
25006cadfe | ||
|
|
d00af57b4a | ||
|
|
85f46b9899 | ||
|
|
50f2beb15b | ||
|
|
561a4cd4bf | ||
|
|
1b7e95b1bd | ||
|
|
f382589083 | ||
|
|
7cdc5c8e93 | ||
|
|
2179c16f60 | ||
|
|
fde7026ac2 | ||
|
|
8520a94b8f | ||
|
|
e39f5d7143 | ||
|
|
3047c55121 | ||
|
|
b875a69266 | ||
|
|
518f1bae20 | ||
|
|
9edd5eeaeb | ||
|
|
b0cc504d7c | ||
|
|
5d5de8ce51 | ||
|
|
a6ee786a4f | ||
|
|
48db589ed2 | ||
|
|
dec30677d9 | ||
|
|
c566b7eca5 | ||
|
|
e8df78f508 | ||
|
|
7cca6ea394 | ||
|
|
3a680df733 | ||
|
|
97d91a895c | ||
|
|
f4aabd0226 | ||
|
|
af75ddd04a | ||
|
|
5140bf9bd0 | ||
|
|
204407b64a | ||
|
|
48d28aa734 | ||
|
|
7e50bedd07 | ||
|
|
7d267d124e | ||
|
|
8b3fcf7740 | ||
|
|
3ac29eb659 | ||
|
|
a55a159fb9 | ||
|
|
e6227f9898 | ||
|
|
a52130e368 | ||
|
|
350eeeebbf | ||
|
|
0ab26a1371 | ||
|
|
49032ae2f2 | ||
|
|
b1fb7a1c1e | ||
|
|
2997c26069 | ||
|
|
a7723ba13f | ||
|
|
3fdd7a4b61 |
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
github: [twinaphex]
|
||||
patreon: libretro
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
|
||||
+14
-1
@@ -36,6 +36,10 @@ matrix:
|
||||
env: DISABLE_OVERLAY=1 CC=gcc-8 CXX=g++-8
|
||||
- compiler: gcc
|
||||
env: DISABLE_CDROM=1 CC=gcc-8 CXX=g++-8
|
||||
- compiler: gcc
|
||||
env: DISABLE_VIDEO_LAYOUT=1 CC=gcc-8 CXX=g++-8
|
||||
- compiler: gcc
|
||||
env: DISABLE_AUDIOMIXER=1 CC=gcc-8 CXX=g++-8
|
||||
- compiler: gcc
|
||||
env: ENABLE_GLES=1 CC=gcc-8 CXX=g++-8
|
||||
- compiler: gcc
|
||||
@@ -55,6 +59,7 @@ matrix:
|
||||
- os: osx
|
||||
osx_image: xcode10.1
|
||||
script:
|
||||
- brew update-reset
|
||||
- brew install --force-bottle qt5
|
||||
- xcodebuild -target RetroArchQt -configuration Release -project pkg/apple/RetroArch_Metal.xcodeproj
|
||||
deploy:
|
||||
@@ -110,6 +115,14 @@ script:
|
||||
if [ -n "$DISABLE_CDROM" ]; then
|
||||
ARGS="$ARGS --disable-cdrom"
|
||||
fi
|
||||
- |
|
||||
if [ -n "$DISABLE_VIDEO_LAYOUT" ]; then
|
||||
ARGS="$ARGS --disable-video_layout"
|
||||
fi
|
||||
- |
|
||||
if [ -n "$DISABLE_AUDIOMIXER" ]; then
|
||||
ARGS="$ARGS --disable-audiomixer"
|
||||
fi
|
||||
- |
|
||||
if [ -n "$ENABLE_GLES" ]; then
|
||||
ARGS="$ARGS --enable-opengles"
|
||||
@@ -152,4 +165,4 @@ addons:
|
||||
build_command: "make"
|
||||
branch_pattern: coverity_scan
|
||||
notifications:
|
||||
email: false
|
||||
email: true
|
||||
+83
-1
@@ -1,4 +1,86 @@
|
||||
# 1.7.9 (future)
|
||||
# Future (1.7.9) [v3]
|
||||
- AI SERVICE: Added in fix for BMP returns to AI service. Added in label passing to AI service call
|
||||
- BSV: Fix BSV recording/playback
|
||||
- BUGFIX: Fix crash when setting Thumbnail Directory
|
||||
- COMMON: Graceful driver switching for Windows and Linux
|
||||
- LAKKA: Wi-Fi Access Point settings
|
||||
- MENU: Menu scaling improvements
|
||||
- MENU/MATERIALUI: Material UI now correctly readjusts its layout when screen orientation changes on mobile devices
|
||||
- MENU/MATERIALUI: Material UI now resizes in real-time when the user manually sets the Menu Scale Factor (this never worked properly with the old DPI override)
|
||||
- MENU/MATERIALUI: Material UI no longer leaks memory on 'context reset' (fonts were previously never free()'d)
|
||||
- MENU/MATERIALUI: A new Android-style 'system bar' has been added. This shows current core name, clock and battery level
|
||||
- MENU/MATERIALUI: A new search icon is shown on the title bar when viewing playlists and file browser lists. Pressing this launches the search interface
|
||||
- MENU/MATERIALUI: The title bar now uses a larger font, and the sublabel font has also been enlarged a little, to more closely align with Material UI standards
|
||||
- MENU/MATERIALUI: A number (quite a large number) of layout/spacing issues have been fixed
|
||||
- MENU/MATERIALUI: The existing colour theme handling code is not fit for purpose, so the whole lot got ripped out and reimplemented. In doing so, also adjusted all the theme colours to better match Material UI standards - with a few liberties taken for aesthetic purposes.
|
||||
- OSD: Fix fast forward indicator when not using menu widgets
|
||||
- PSP1: Remove duplicated FPS indicator on the screen
|
||||
- SWITCH: Make audren threaded audio driver the new default
|
||||
- VIDEO LAYOUT: Add video layout mame overlay compatibility. Enabled for Windows/Linux/OSX/iOS/Android/libnx. Only works with GL driver for now
|
||||
|
||||
# (1.7.9) (v2)
|
||||
- 3DS: Fix 3DS screen flickering when OSD is enabled
|
||||
- IOS: Fix crash that could happen at startup
|
||||
- MENU/MATERIALUI: Change DPI scaling back to original - too many issues with current implementation, requires a redesign
|
||||
|
||||
# (1.7.9)
|
||||
- AI SERVICE: Image mode is now much faster, it now saves the image in-memory in PNG format then passes it along to the translation service
|
||||
- BUGFIX: Touch input - When using an overlay to toggle the quick menu on touchscreen devices, we no longer get 'phantom' menu input - i.e. the old bug of hitting the toggle and instantly resuming content (or performing a save state) is fixed
|
||||
- BUGFIX: Networking - RetroArch crashed when pressing left while Relay Server Location entry was selected
|
||||
- BUGFIX: Networking - fix memory leak that could happen at exit after a network
|
||||
operation had run
|
||||
- CHEEVOS: Improve handling of line endings when calculating CD hashes for retroachievements
|
||||
- CHEEVOS: Add support for Sega CD/Saturn; reduce hash calls to server
|
||||
- FPGA: Add initial FPGA port for Z-Turn boards - not really release-ready yet, will need community support to continue. Currently employs naive framebuffer approach, not fullspeed
|
||||
- GL1: GLDirect (D3D9 to OGL1.1 wrapper) support
|
||||
- GONG: Stability fixes
|
||||
- LINUX/UDEV: Fix touchscreen/lightgun issues
|
||||
- MENU/MATERIALUI: MaterialUI no longer 'forgets' its place when navigating backwards in menus, and navigation in general is 'cleaner'.
|
||||
- MENU/MATERIALUI: Add initial gesture support
|
||||
- MENU/MATERIALUI: Improved touch support
|
||||
- MENU/MATERIALUI: Bugfix - Random' items are no longer automatically highlighted when performing standard up/down 'flick' scrolling through lists (items are only highlighted when you keep the pointer still for > 200 ms)
|
||||
- MENU/MATERIALUI: Bugfix - The display no longer 'jerks' for one frame when navigating backwards through lists
|
||||
- MENU/MATERIALUI: Bugfix - The Material UI scaling factor is now based upon the device-reported screen DPI value (previously it relied upon a hard-coded magic number, which was never correct)
|
||||
- MENU/RGUI: Functional mouse/touchscreen support
|
||||
- MENU/ONSCREEN KEYBOARD: On-screen keyboard entry via mouse/touchscreen has been tidied up - no more double inputs (or unwanted menu interaction in the background)
|
||||
- MENU/MOUSE: Mouse wheel up/down is now a proper 'up/down', same as using cursor keys or a dpad
|
||||
- MENU/MOUSE: Mouse wheel tilt left/right has been wired up to normal 'left/right' commands. Also further improved mouse wheel tilt
|
||||
- MENU/OZONE: Add option to toggle between static and scrolling content metadata
|
||||
- MENU/XMB: Add full gesture support
|
||||
- MENU/OSX: Fixed mouse buttons - mouse down events were not hooked up
|
||||
- MENU: When navigating backwards from a core options drop-down list (i.e. pressing select or cancel), the last menu position is remembered (instead of resetting back to the first core option item each time)
|
||||
- MENU: Add mouse/touchscreen gesture support
|
||||
- MENU: Add option to delete playlists (Settings > Playlists > Playlist Management)
|
||||
- MOBILE (ANDROID/IOS): Add option to automatically rotate overlays when changing orientation
|
||||
- OSD: Memory details should now be available on every platform (get_mem_total and get_mem_free need to be implemented in the frontend driver for it to work)
|
||||
- OSD: Memory details can now be shown individually without FPS and frame count
|
||||
- PS2: Fix memory leaks in font/video driver
|
||||
- SWITCH: Set default aspect ratio to core provided instead of 4:3
|
||||
- THREADED VIDEO: Fix FPS text in threaded video mode
|
||||
- VITA: Set default aspect ratio to core provided instead of 4:3
|
||||
- VITA: Add system language detection
|
||||
- VITA: More memory support
|
||||
- WIN32: Log window now has title 'Logging Console'
|
||||
- WII: Add Wiimote lightgun support
|
||||
|
||||
# 1.7.8 (v4)
|
||||
- COMMON: Enable customisation of runtime 'last played' display format.
|
||||
- CHEEVOS: Add hashing support for PSX (bin/cue, chd, or real CD) (for real this time, got added in the CHANGELOG for v2 then reverted before it hit release)
|
||||
- IOS: Update for iOS 13, fix the asset packaging issues
|
||||
- LOCALIZATION: Update Portuguese Brazilian Translation
|
||||
- MENU: Add 12-hour time/date versions of all formats
|
||||
- SWITCH: Add 'AI Service' option to Switch (untested)
|
||||
- SWITCH: Update to newest libnx
|
||||
|
||||
# 1.7.8 (v3)
|
||||
- GLCORE: Ensure correct scaling of menu texture (with RGUI)
|
||||
- IPS: Soft-Patch any IPS size
|
||||
- METAL: Fix overlay issue - setup correct viewport before rendering overlay
|
||||
- METAL/STB: Fix font driver issue with AMD GPUs on MacOS.
|
||||
- MENU/RGUI: Correctly rescale menu when resizing window if aspect ratio lock is enabled.
|
||||
- OSX: Remove OSX suffix in window title
|
||||
- PSP: Fix audio conversion code
|
||||
- REMAPS: Fix analog remapping regression -analog remapping would break controls
|
||||
|
||||
# 1.7.8 (v2)
|
||||
- 3DS: Fix 3DS startup crash
|
||||
|
||||
@@ -53,6 +53,10 @@ ifneq ($(findstring DOS,$(OS)),)
|
||||
LDFLAGS += -lemu
|
||||
endif
|
||||
|
||||
ifneq ($(findstring FPGA,$(OS)),)
|
||||
DEFINES += -DHAVE_FPGA
|
||||
endif
|
||||
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
LDFLAGS += -static-libgcc -lwinmm
|
||||
endif
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
# This build was put together and is maintained by ModMyClassic.com for Libretro.
|
||||
# The purpose is to give Libretro a proper "official" build platform for classic consoles.
|
||||
# If you need any help in building for the classics or have any questions then please visit
|
||||
# https://modmyclassic.com/comp and we will help in any way possible!
|
||||
|
||||
# Building Prerequisites ##############
|
||||
# arm-linux-gnueabihf-strip
|
||||
# patchelf
|
||||
# bc
|
||||
|
||||
include version.all
|
||||
|
||||
# Classic Readme Variables ############
|
||||
CLASSIC_ALT_VER := $(shell echo $(RARCH_VERSION) | tr . _)
|
||||
CLASSIC_MODS_VER := Official_Retroarch_v$(CLASSIC_ALT_VER)
|
||||
CLASSIC_MODS_NAME := RetroArch v$(RARCH_VERSION) (Official Optimised)
|
||||
CLASSIC_VERSION := $(RARCH_VERSION)
|
||||
MOD_CREATOR := Libretro + ModMyClassic
|
||||
MOD_CATEGORY := RetroArch
|
||||
GIT_COMMIT := $(shell echo "`git rev-parse --short HEAD``git diff-index --quiet HEAD -- || echo '-dirty'`")
|
||||
|
||||
# Platform dependant Variables ########
|
||||
HAKCHI_DIR := RA_Platform-Hakchi
|
||||
HAKCHI_GIT := https://github.com/Classicmods/RA_Platform-Hakchi
|
||||
|
||||
# General Shared Variables ############
|
||||
TARGET := retroarch
|
||||
|
||||
# Libretro Defines ####################
|
||||
#HAVE_CLASSIC = Classic Hook, disable some features
|
||||
#HAVE_C_A7A7 = Classic Armv7 Cortex A7 optimisation override
|
||||
#HAVE_HAKCHI = Hakchi Hook, change default configurations etc (TODO)
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
retroarch:
|
||||
#Build the RetroArch Binary for cross platform classics (ARMv7 Cortex A7)
|
||||
patchelf --version #Check if you have patchelf installed... (sudo apt-get install patchelf)
|
||||
CFLAGS="-marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard" ./configure --host=arm-linux-gnueabihf --enable-mali_fbdev --disable-freetype --enable-opengles --enable-udev --enable-alsa --enable-neon --enable-floathard --disable-discord
|
||||
make HAVE_CLASSIC=1 HAVE_C_A7A7=1 HAVE_HAKCHI=1 -j #Cook it
|
||||
arm-linux-gnueabihf-strip -v retroarch
|
||||
patchelf --replace-needed libSDL2-2.0.so.0 libSDL2.so retroarch #libSDL2-2.0.so.0 sym link doesn't exist on native build. Just patch the binary...
|
||||
|
||||
#HAKCHI BUILD (NESC, SNESC)
|
||||
#FYI this build was originally known as RetroArch 'Neo' for Hakchi.
|
||||
@echo "** BUILDING CLASSIC_MODS HAKCHI - $(CLASSIC_MODS_VER) HMOD PACKAGE **"
|
||||
rm -fr /tmp/$(HAKCHI_DIR)
|
||||
cd /tmp/; git clone $(HAKCHI_GIT)
|
||||
cp retroarch /tmp/$(HAKCHI_DIR)/bin/retroarch
|
||||
echo $$(echo "Built by: " $$USER @ $$(date) \\\\\\ Git Commit: $(GIT_COMMIT)) > /tmp/$(HAKCHI_DIR)/etc/libretro/retroarch_version
|
||||
cp /tmp/$(HAKCHI_DIR)/readme.md /tmp/$(HAKCHI_DIR)/readme_COPY.md
|
||||
printf "%s\n" \
|
||||
"---" \
|
||||
"Name: $(CLASSIC_MODS_NAME)" \
|
||||
"Creator: $(MOD_CREATOR)" \
|
||||
"Category: $(MOD_CATEGORY)" \
|
||||
"Version: $(CLASSIC_MODS_VER)" \
|
||||
"Built on: $(shell date)" \
|
||||
"Git commit: $(GIT_COMMIT)" \
|
||||
"---" > /tmp/$(HAKCHI_DIR)/readme.md
|
||||
cat /tmp/$(HAKCHI_DIR)/readme_COPY.md >> /tmp/$(HAKCHI_DIR)/readme.md
|
||||
rm /tmp/$(HAKCHI_DIR)/readme_COPY.md
|
||||
@echo "** COMPRESSING $(CLASSIC_MODS_VER) HMOD PACKAGE **"
|
||||
cd /tmp/$(HAKCHI_DIR)/; tar -czvf "$(CLASSIC_MODS_VER).hmod" *
|
||||
mv /tmp/$(HAKCHI_DIR)/$(CLASSIC_MODS_VER).hmod .
|
||||
@echo "** BUILT CLASSIC_MODS HAKCHI - $(CLASSIC_MODS_VER) HMOD PACKAGE **"
|
||||
rm -fr /tmp/$(HAKCHI_DIR) #clean up tmp
|
||||
|
||||
@echo "*********************************************************************"
|
||||
@echo "*** Classic ARM7 Cortex A7 build and packages built successfully! ***"
|
||||
@echo "*********************************************************************"
|
||||
clean:
|
||||
rm -rf obj-unix
|
||||
rm -f *.d
|
||||
rm -f *.o
|
||||
rm -f audio/*.o
|
||||
rm -f conf/*.o
|
||||
rm -f gfx/*.o
|
||||
rm -f gfx/drivers_font/*.o
|
||||
rm -f gfx/drivers_font_renderer/*.o
|
||||
rm -f gfx/drivers_context/*.o
|
||||
rm -f gfx/py_state/*.o
|
||||
rm -f compat/*.o
|
||||
rm -f record/*.o
|
||||
rm -f input/*.o
|
||||
rm -f tools/*.o
|
||||
rm -f $(BINDIR)/retroarch
|
||||
rm -f $(BINDIR)/retroarch-joyconfig
|
||||
rm -f $(PNDDIR)/readme.html
|
||||
rm -f retroarch
|
||||
rm -f $(CLASSIC_MODS_VER).hmod
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
# This build was put together and is maintained by ModMyClassic.com for Libretro.
|
||||
# The purpose is to give Libretro a proper "official" build platform for classic consoles.
|
||||
# If you need any help in building for the classics or have any questions then please visit
|
||||
# https://modmyclassic.com and we will help in any way possible!
|
||||
|
||||
# Building Prerequisites ##############
|
||||
# arm-linux-gnueabihf-strip
|
||||
|
||||
include version.all
|
||||
|
||||
# General Shared Variables ############
|
||||
TARGET := retroarch
|
||||
|
||||
# Libretro Defines ####################
|
||||
#HAVE_CLASSIC = Classic Hook, disable some features
|
||||
#HAVE_C_A7A7 = Classic Armv7 Cortex A7 optimisation override
|
||||
#HAVE_SEGAM = Sega Mini Hook, change default configurations etc (TODO)
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
retroarch:
|
||||
#Build the RetroArch Binary for cross platform classics (ARMv7 Cortex A7)
|
||||
patchelf --version #Check if you have patchelf installed... (sudo apt-get install patchelf)
|
||||
CFLAGS="-marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard" ./configure --host=arm-linux-gnueabihf --disable-wayland --disable-x11 --disable-opengl --disable-opengl1 --disable-opengl_core --enable-mali_fbdev --disable-freetype --enable-opengles --enable-udev --enable-alsa --enable-neon --enable-floathard --disable-discord
|
||||
make HAVE_CLASSIC=1 HAVE_C_A7A7=1 HAVE_SEGAM=1 -j #Cook it
|
||||
arm-linux-gnueabihf-strip -v retroarch
|
||||
@echo "*********************************************************************"
|
||||
@echo "*** SEGA Mega Drive Mini RetroArch binary built successfully! ***"
|
||||
@echo "*********************************************************************"
|
||||
clean:
|
||||
rm -rf obj-unix
|
||||
rm -f *.d
|
||||
rm -f *.o
|
||||
rm -f audio/*.o
|
||||
rm -f conf/*.o
|
||||
rm -f gfx/*.o
|
||||
rm -f gfx/drivers_font/*.o
|
||||
rm -f gfx/drivers_font_renderer/*.o
|
||||
rm -f gfx/drivers_context/*.o
|
||||
rm -f gfx/py_state/*.o
|
||||
rm -f compat/*.o
|
||||
rm -f record/*.o
|
||||
rm -f input/*.o
|
||||
rm -f tools/*.o
|
||||
rm -f $(BINDIR)/retroarch
|
||||
rm -f $(BINDIR)/retroarch-joyconfig
|
||||
rm -f $(PNDDIR)/readme.html
|
||||
rm -f retroarch
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
# This build was put together and is maintained by ModMyClassic.com for Libretro.
|
||||
# The purpose is to give Libretro a proper "official" build platform for classic consoles.
|
||||
# If you need any help in building for the classics or have any questions then please visit
|
||||
# https://modmyclassic.com and we will help in any way possible!
|
||||
|
||||
# INFO: THIS BUILD TARGET ALSO COVERS THE NESC!!!
|
||||
|
||||
# Building Prerequisites ##############
|
||||
# arm-linux-gnueabihf-strip
|
||||
# patchelf
|
||||
|
||||
include version.all
|
||||
|
||||
# General Shared Variables ############
|
||||
TARGET := retroarch
|
||||
|
||||
# Libretro Defines ####################
|
||||
#HAVE_CLASSIC = Classic Hook, disable some features
|
||||
#HAVE_C_A7A7 = Classic Armv7 Cortex A7 optimisation override
|
||||
#HAVE_HAKCHI = Hakchi Hook, change default configurations etc (TODO)
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
retroarch:
|
||||
#Build the RetroArch Binary for cross platform classics (ARMv7 Cortex A7)
|
||||
patchelf --version #Check if you have patchelf installed... (sudo apt-get install patchelf)
|
||||
CFLAGS="-marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard" ./configure --host=arm-linux-gnueabihf --disable-wayland --disable-x11 --disable-opengl --disable-opengl1 --disable-opengl_core --enable-mali_fbdev --disable-freetype --enable-opengles --enable-udev --enable-alsa --enable-neon --enable-floathard --disable-discord
|
||||
make HAVE_CLASSIC=1 HAVE_C_A7A7=1 HAVE_HAKCHI=1 -j #Cook it
|
||||
arm-linux-gnueabihf-strip -v retroarch
|
||||
patchelf --replace-needed libSDL2-2.0.so.0 libSDL2.so retroarch #libSDL2-2.0.so.0 sym link doesn't exist on native build. Just patch the binary...
|
||||
@echo "*********************************************************************"
|
||||
@echo "*** NES/SNES Classic RetroArch binary built successfully! ***"
|
||||
@echo "*********************************************************************"
|
||||
clean:
|
||||
rm -rf obj-unix
|
||||
rm -f *.d
|
||||
rm -f *.o
|
||||
rm -f audio/*.o
|
||||
rm -f conf/*.o
|
||||
rm -f gfx/*.o
|
||||
rm -f gfx/drivers_font/*.o
|
||||
rm -f gfx/drivers_font_renderer/*.o
|
||||
rm -f gfx/drivers_context/*.o
|
||||
rm -f gfx/py_state/*.o
|
||||
rm -f compat/*.o
|
||||
rm -f record/*.o
|
||||
rm -f input/*.o
|
||||
rm -f tools/*.o
|
||||
rm -f $(BINDIR)/retroarch
|
||||
rm -f $(BINDIR)/retroarch-joyconfig
|
||||
rm -f $(PNDDIR)/readme.html
|
||||
rm -f retroarch
|
||||
|
||||
+44
-11
@@ -595,7 +595,9 @@ ifeq ($(HAVE_ALSA), 1)
|
||||
OBJ += audio/drivers/alsa.o
|
||||
|
||||
ifneq ($(HAVE_HAKCHI), 1)
|
||||
OBJ += midi/drivers/alsa_midi.o
|
||||
ifneq ($(HAVE_SEGAM), 1)
|
||||
OBJ += midi/drivers/alsa_midi.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_THREADS), 1)
|
||||
@@ -799,7 +801,6 @@ endif
|
||||
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += menu/menu_driver.o \
|
||||
menu/menu_content.o \
|
||||
menu/menu_setting.o \
|
||||
menu/widgets/menu_filebrowser.o \
|
||||
menu/widgets/menu_dialog.o \
|
||||
@@ -843,13 +844,14 @@ endif
|
||||
|
||||
ifeq ($(HAVE_VIDEO_LAYOUT), 1)
|
||||
DEFINES += -DHAVE_VIDEO_LAYOUT
|
||||
OBJ += gfx/video_layout.o \
|
||||
gfx/video_layout/view.o \
|
||||
gfx/video_layout/element.o \
|
||||
gfx/video_layout/component.o \
|
||||
gfx/video_layout/internal.o \
|
||||
gfx/video_layout/scope.o \
|
||||
gfx/video_layout/load.o
|
||||
OBJ += \
|
||||
gfx/video_layout.o \
|
||||
gfx/video_layout/view.o \
|
||||
gfx/video_layout/element.o \
|
||||
gfx/video_layout/component.o \
|
||||
gfx/video_layout/internal.o \
|
||||
gfx/video_layout/scope.o \
|
||||
gfx/video_layout/load.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_STB_FONT), 1)
|
||||
@@ -1129,6 +1131,24 @@ ifeq ($(HAVE_SIXEL), 1)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_NETWORK_VIDEO), 1)
|
||||
ifneq ($(NETWORK_VIDEO_HOST),)
|
||||
DEFINES += -DNETWORK_VIDEO_HOST=$(NETWORK_VIDEO_HOST)
|
||||
else
|
||||
DEFINES += -DNETWORK_VIDEO_HOST=127.0.0.1
|
||||
endif
|
||||
|
||||
ifneq ($(NETWORK_VIDEO_PORT),)
|
||||
DEFINES += -DNETWORK_VIDEO_PORT=$(NETWORK_VIDEO_PORT)
|
||||
else
|
||||
DEFINES += -DNETWORK_VIDEO_PORT=4953
|
||||
endif
|
||||
|
||||
DEFINES += -DHAVE_NETWORK_VIDEO
|
||||
OBJ += gfx/drivers/network_gfx.o \
|
||||
gfx/drivers_context/network_ctx.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_PLAIN_DRM), 1)
|
||||
OBJ += gfx/drivers/drm_gfx.o
|
||||
INCLUDE_DIRS += -I/usr/include/libdrm
|
||||
@@ -1255,7 +1275,8 @@ endif
|
||||
|
||||
ifeq ($(HAVE_SDL2), 1)
|
||||
HAVE_SDL_COMMON = 1
|
||||
OBJ += gfx/drivers/sdl2_gfx.o
|
||||
OBJ += gfx/drivers/sdl2_gfx.o \
|
||||
gfx/common/sdl2_common.o
|
||||
DEF_FLAGS += $(SDL2_CFLAGS)
|
||||
LIBS += $(SDL2_LIBS)
|
||||
else ifeq ($(HAVE_SDL), 1)
|
||||
@@ -1777,6 +1798,7 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
cheevos-new/fixup.o \
|
||||
cheevos-new/parser.o \
|
||||
cheevos-new/hash.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/cdfs/cdfs.o \
|
||||
deps/rcheevos/src/rcheevos/trigger.o \
|
||||
deps/rcheevos/src/rcheevos/condset.o \
|
||||
deps/rcheevos/src/rcheevos/condition.o \
|
||||
@@ -1893,6 +1915,13 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(findstring FPGA,$(OS)),)
|
||||
OBJ += gfx/drivers/fpga_gfx.o \
|
||||
gfx/drivers_context/fpga_ctx.o \
|
||||
gfx/drivers_font/fpga_font.o \
|
||||
menu/drivers_display/menu_display_fpga.o
|
||||
endif
|
||||
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
OBJ += media/rarch.o \
|
||||
gfx/common/win32_common.o \
|
||||
@@ -2010,7 +2039,7 @@ endif
|
||||
##################################
|
||||
### Classic Platform specifics ###
|
||||
###############WIP################
|
||||
# Help at https://modmyclassic.com/comp
|
||||
# Help at https://modmyclassic.com
|
||||
|
||||
ifeq ($(HAVE_CLASSIC), 1)
|
||||
DEFINES += -DHAVE_CLASSIC
|
||||
@@ -2040,4 +2069,8 @@ endif
|
||||
ifeq ($(HAVE_HAKCHI), 1)
|
||||
DEFINES += -DHAVE_HAKCHI
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_SEGAM), 1)
|
||||
DEFINES += -DHAVE_SEGAM
|
||||
endif
|
||||
##################################
|
||||
+2
-1
@@ -21,6 +21,7 @@ OBJ :=
|
||||
|
||||
DEFINES := -D__SWITCH__=1 -U__linux__ -U__linux -DGLM_FORCE_PURE=1 -DRARCH_CONSOLE -DRARCH_INTERNAL -DGLOBAL_CONFIG_DIR='"/switch"' -DHAVE_STB_VORBIS
|
||||
|
||||
HAVE_TRANSLATE = 1
|
||||
HAVE_AUDIOMIXER = 1
|
||||
HAVE_CC_RESAMPLER = 1
|
||||
HAVE_MENU_COMMON = 1
|
||||
@@ -60,7 +61,7 @@ ifeq ($(HAVE_OPENGL), 1)
|
||||
HAVE_XMB = 1
|
||||
HAVE_OZONE = 1
|
||||
HAVE_OVERLAY = 1
|
||||
HAVE_VIDEO_LAYOUT = 0
|
||||
HAVE_VIDEO_LAYOUT = 1
|
||||
HAVE_GLSL = 1
|
||||
else
|
||||
HAVE_RGUI = 1
|
||||
|
||||
+4
-1
@@ -1,4 +1,4 @@
|
||||
BUILD_PRX = 0
|
||||
BUILD_FOR_PCSX2 = 0
|
||||
DEBUG = 0
|
||||
HAVE_KERNEL_PRX = 0
|
||||
HAVE_LOGGER = 0
|
||||
@@ -45,6 +45,9 @@ LDFLAGS += -L$(PS2SDK)/ports/lib -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ee/lib -L$(CD
|
||||
LIBS += -lretro_ps2 -lgskit -ldmakit -lgskit_toolkit -laudsrv -lmf -lpadx -lmtap -lmc -lhdd -lsdl -lfileXio -lz
|
||||
LIBS += -lcdvdfs -lpatches -lpoweroff
|
||||
|
||||
ifeq ($(BUILD_FOR_PCSX2), 1)
|
||||
RARCH_DEFINES += -DBUILD_FOR_PCSX2
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_THREADS), 1)
|
||||
RARCH_DEFINES += -DHAVE_THREADS
|
||||
|
||||
+8
-8
@@ -85,18 +85,16 @@ LD := $(CXX)
|
||||
LIBDIRS := -L.
|
||||
|
||||
ARCHFLAGS := -march=armv7-a -mfpu=neon -mfloat-abi=hard -DVITA
|
||||
CFLAGS += $(ARCHFLAGS) -mword-relocations -fno-optimize-sibling-calls
|
||||
CFLAGS += $(ARCHFLAGS) -mword-relocations -fno-optimize-sibling-calls -O2
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -O2 -g
|
||||
else
|
||||
CFLAGS += -O3
|
||||
CFLAGS += -g
|
||||
endif
|
||||
|
||||
ASFLAGS := $(CFLAGS)
|
||||
LDFLAGS := -Wl,-q
|
||||
|
||||
CFLAGS += -Wall -ffast-math
|
||||
CFLAGS += -Wall -ffast-math -g
|
||||
CFLAGS += -DRARCH_INTERNAL -DRARCH_CONSOLE
|
||||
CFLAGS += -DHAVE_FILTERS_BUILTIN $(DEFINES)
|
||||
|
||||
@@ -114,7 +112,7 @@ ifeq ($(WHOLE_ARCHIVE_LINK), 1)
|
||||
endif
|
||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
||||
|
||||
VITA_LIBS := -lSceDisplay_stub -lSceGxm_stub -lSceNet_stub -lSceNetCtl_stub \
|
||||
VITA_LIBS := -lSceDisplay_stub -lSceGxm_stub -lSceNet_stub -lSceNetCtl_stub -lSceAppUtil_stub \
|
||||
-lSceSysmodule_stub -lSceCtrl_stub -lSceHid_stub -lSceTouch_stub -lSceAudio_stub \
|
||||
-lScePower_stub -lSceRtc_stub -lSceCommonDialog_stub -lScePgf_stub \
|
||||
-lSceFiber_stub -lSceMotion_stub -lSceAppMgr_stub -lpthread -lpng -lz
|
||||
@@ -154,17 +152,19 @@ $(TARGET).elf: $(OBJ) libretro_vita.a
|
||||
$(LD) $(OBJ) $(LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
|
||||
|
||||
%.velf: %.elf
|
||||
cp $< $<.unstripped.elf
|
||||
$(PREFIX)strip -g $<
|
||||
vita-elf-create $< $@
|
||||
|
||||
%.self: %.velf
|
||||
vita-make-fself -c -s $< $@
|
||||
|
||||
%.vpk: %.self
|
||||
vita-mksfoex -s TITLE_ID=$(VITA_TITLE_ID) "$(VITA_TITLE_NAME)" param.sfo
|
||||
vita-mksfoex -s TITLE_ID=$(VITA_TITLE_ID) "$(VITA_TITLE_NAME)" -d ATTRIBUTE2=12 param.sfo
|
||||
vita-pack-vpk -s param.sfo -b $< $@
|
||||
|
||||
clean:
|
||||
rm -f $(OBJ) $(TARGET).elf $(TARGET).velf $(TARGET).self param.sfo $(TARGET).vpk
|
||||
rm -f $(OBJ) $(TARGET).elf $(TARGET).elf.unstripped.elf $(TARGET).velf $(TARGET).self param.sfo $(TARGET).vpk
|
||||
rm -f $(OBJ:.o=.depend)
|
||||
|
||||
# Useful for developers
|
||||
|
||||
@@ -21,7 +21,7 @@ RARCH_DEFINES = -DVITA -DIS_SALAMANDER -DRARCH_CONSOLE
|
||||
|
||||
LIBDIR =
|
||||
LDFLAGS =
|
||||
LIBS = -lSceDisplay_stub -lSceGxm_stub -lSceNet_stub -lSceNetCtl_stub\
|
||||
LIBS = -lSceDisplay_stub -lSceGxm_stub -lSceNet_stub -lSceNetCtl_stub -lSceAppUtil_stub\
|
||||
-lSceSysmodule_stub -lSceCtrl_stub -lSceHid_stub -lSceAudio_stub -lSceFiber_stub\
|
||||
-lScePower_stub -lSceRtc_stub -lSceCommonDialog_stub -lScePgf_stub \
|
||||
-lSceMotion_stub -lSceAppMgr_stub -lfreetype -lpng -lm -lc
|
||||
@@ -55,7 +55,7 @@ OBJS = frontend/frontend_salamander.o \
|
||||
all: $(TARGET).vpk
|
||||
|
||||
%.vpk: eboot.bin
|
||||
vita-mksfoex -s TITLE_ID=$(TITLE_ID) "$(TARGET)" param.sfo
|
||||
vita-mksfoex -s TITLE_ID=$(TITLE_ID) "$(TARGET)" -d ATTRIBUTE2=12 param.sfo
|
||||
vita-pack-vpk -s param.sfo -b eboot.bin $@
|
||||
|
||||
eboot.bin: $(TARGET).velf
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
#include <psp2/kernel/sysmem.h>
|
||||
#include <psp2/kernel/threadmgr.h>
|
||||
|
||||
#define RAM_THRESHOLD 0xA00000 // Memory left to the system for threads and other internal stuffs
|
||||
|
||||
static int _newlib_heap_memblock;
|
||||
static unsigned _newlib_heap_size;
|
||||
static char *_newlib_heap_base, *_newlib_heap_end, *_newlib_heap_cur;
|
||||
char *_newlib_heap_base, *_newlib_heap_end, *_newlib_heap_cur;
|
||||
static char _newlib_sbrk_mutex[32] __attribute__ ((aligned (8)));
|
||||
|
||||
static int _newlib_vm_memblock;
|
||||
@@ -50,11 +52,16 @@ void _init_vita_heap(void) {
|
||||
if (sceKernelCreateLwMutex((struct SceKernelLwMutexWork*)_newlib_sbrk_mutex, "sbrk mutex", 0, 0, 0) < 0) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
// Always allocating the max avaliable USER_RW mem on the system
|
||||
SceKernelFreeMemorySizeInfo info;
|
||||
info.size = sizeof(SceKernelFreeMemorySizeInfo);
|
||||
sceKernelGetFreeMemorySize(&info);
|
||||
|
||||
if (&_newlib_heap_size_user != NULL) {
|
||||
_newlib_heap_size = _newlib_heap_size_user;
|
||||
}else{
|
||||
_newlib_heap_size = 192 * 1024 * 1024;
|
||||
_newlib_heap_size = info.size_user - RAM_THRESHOLD;
|
||||
}
|
||||
|
||||
_newlib_heap_size -= _newlib_vm_size;
|
||||
|
||||
+407
-172
@@ -21,6 +21,7 @@
|
||||
#include <streams/interface_stream.h>
|
||||
#include <streams/file_stream.h>
|
||||
#include <features/features_cpu.h>
|
||||
#include <formats/cdfs.h>
|
||||
#include <compat/strl.h>
|
||||
#include <rhash.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
@@ -1067,7 +1068,9 @@ static void rcheevos_unlock_cb(unsigned id, void* userdata)
|
||||
#ifndef CHEEVOS_DONT_DEACTIVATE
|
||||
cheevo->active &= ~*(unsigned*)userdata;
|
||||
#endif
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "cheevo %u deactivated: %s\n", id, cheevo->info->title);
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "cheevo %u deactivated (%s): %s\n", id,
|
||||
(*(unsigned*)userdata) == RCHEEVOS_ACTIVE_HARDCORE ? "hardcore" : "softcore",
|
||||
cheevo->info->title);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1098,8 +1101,9 @@ typedef struct
|
||||
char url[256];
|
||||
char badge_basepath[PATH_MAX_LENGTH];
|
||||
char badge_fullpath[PATH_MAX_LENGTH];
|
||||
unsigned char last_hash[16];
|
||||
unsigned char hash[16];
|
||||
bool round;
|
||||
unsigned ext_hash;
|
||||
unsigned gameid;
|
||||
unsigned i;
|
||||
unsigned j;
|
||||
@@ -1123,6 +1127,7 @@ typedef struct
|
||||
struct http_connection_t *conn;
|
||||
struct http_t *http;
|
||||
const rcheevos_cheevo_t *cheevo_end;
|
||||
cdfs_file_t cdfp;
|
||||
|
||||
/* co-routine required fields */
|
||||
CORO_FIELDS
|
||||
@@ -1131,14 +1136,14 @@ typedef struct
|
||||
enum
|
||||
{
|
||||
/* Negative values because CORO_SUB generates positive values */
|
||||
RCHEEVOS_SNES_MD5 = -1,
|
||||
RCHEEVOS_GENESIS_MD5 = -2,
|
||||
RCHEEVOS_GENERIC_MD5 = -1,
|
||||
RCHEEVOS_SNES_MD5 = -2,
|
||||
RCHEEVOS_LYNX_MD5 = -3,
|
||||
RCHEEVOS_NES_MD5 = -4,
|
||||
RCHEEVOS_GENERIC_MD5 = -5,
|
||||
RCHEEVOS_FILENAME_MD5 = -6,
|
||||
RCHEEVOS_PSX_MD5 = -5,
|
||||
RCHEEVOS_ARCADE_MD5 = -6,
|
||||
RCHEEVOS_EVAL_MD5 = -7,
|
||||
RCHEEVOS_FILL_MD5 = -8,
|
||||
RCHEEVOS_SEGACD_MD5 = -8,
|
||||
RCHEEVOS_GET_GAMEID = -9,
|
||||
RCHEEVOS_GET_CHEEVOS = -10,
|
||||
RCHEEVOS_GET_BADGES = -11,
|
||||
@@ -1155,23 +1160,13 @@ static int rcheevos_iterate(rcheevos_coro_t* coro)
|
||||
const int lynx_header_len = 0x40;
|
||||
ssize_t num_read = 0;
|
||||
size_t to_read = 4096;
|
||||
uint8_t *buffer = NULL;
|
||||
uint8_t *ptr = NULL;
|
||||
const char *end = NULL;
|
||||
|
||||
static const uint32_t genesis_exts[] =
|
||||
{
|
||||
0x0b888feeU, /* mdx */
|
||||
0x005978b6U, /* md */
|
||||
0x0b88aa89U, /* smd */
|
||||
0x0b88767fU, /* gen */
|
||||
0x0b8861beU, /* bin */
|
||||
0x0b886782U, /* cue */
|
||||
0x0b8880d0U, /* iso */
|
||||
0x0b88aa98U, /* sms */
|
||||
0x005977f3U, /* gg */
|
||||
0x0059797fU, /* sg */
|
||||
0
|
||||
};
|
||||
size_t exe_name_size = 0;
|
||||
char exe_name_buffer[64];
|
||||
char* exe_name = NULL;
|
||||
char* scan = NULL;
|
||||
char buffer[2048];
|
||||
|
||||
static const uint32_t snes_exts[] =
|
||||
{
|
||||
@@ -1186,20 +1181,52 @@ static int rcheevos_iterate(rcheevos_coro_t* coro)
|
||||
0
|
||||
};
|
||||
|
||||
static const uint32_t nes_exts[] =
|
||||
{
|
||||
0x0b88944bU, /* nes */
|
||||
0
|
||||
};
|
||||
|
||||
static const uint32_t lynx_exts[] =
|
||||
{
|
||||
0x0b888cf7U, /* lnx */
|
||||
0
|
||||
};
|
||||
|
||||
static const uint32_t psx_exts[] =
|
||||
{
|
||||
0x0b886782U, /* cue */
|
||||
0x0b88899aU, /* m3u */
|
||||
/*0x0b88af0bU,* toc */
|
||||
/*0x0b88652fU,* ccd */
|
||||
/*0x0b889c67U,* pbp */
|
||||
0x0b8865d4U, /* chd */
|
||||
0
|
||||
};
|
||||
|
||||
static const uint32_t segacd_exts[] =
|
||||
{
|
||||
0x0b886782U, /* cue */
|
||||
0x0b8880d0U, /* iso */
|
||||
0x0b8865d4U, /* chd */
|
||||
0
|
||||
};
|
||||
|
||||
static const uint32_t arcade_exts[] =
|
||||
{
|
||||
0x0b88c7d8U, /* zip */
|
||||
0
|
||||
};
|
||||
|
||||
static rcheevos_finder_t finders[] =
|
||||
{
|
||||
{RCHEEVOS_SNES_MD5, "SNES (discards header)", snes_exts},
|
||||
{RCHEEVOS_GENESIS_MD5, "Genesis (6Mb padding)", genesis_exts},
|
||||
{RCHEEVOS_LYNX_MD5, "Atari Lynx (discards header)", lynx_exts},
|
||||
{RCHEEVOS_NES_MD5, "NES (discards header)", NULL},
|
||||
{RCHEEVOS_GENERIC_MD5, "Generic (plain content)", NULL},
|
||||
{RCHEEVOS_FILENAME_MD5, "Generic (filename)", NULL}
|
||||
{RCHEEVOS_LYNX_MD5, "Atari Lynx (discards header)", lynx_exts},
|
||||
{RCHEEVOS_NES_MD5, "NES (discards header)", nes_exts},
|
||||
{RCHEEVOS_PSX_MD5, "Playstation (main executable)", psx_exts},
|
||||
{RCHEEVOS_SEGACD_MD5, "Sega CD/Saturn (first sector)", segacd_exts},
|
||||
{RCHEEVOS_ARCADE_MD5, "Arcade (filename)", arcade_exts},
|
||||
{RCHEEVOS_GENERIC_MD5, "Generic (plain content)", NULL}
|
||||
};
|
||||
|
||||
CORO_ENTER();
|
||||
@@ -1243,15 +1270,13 @@ static int rcheevos_iterate(rcheevos_coro_t* coro)
|
||||
|
||||
for (;;)
|
||||
{
|
||||
buffer = (uint8_t*)coro->data + coro->len;
|
||||
ptr = (uint8_t*)coro->data + coro->len;
|
||||
to_read = 4096;
|
||||
|
||||
if (to_read > coro->count)
|
||||
to_read = coro->count;
|
||||
|
||||
num_read = intfstream_read(coro->stream,
|
||||
(void*)buffer, to_read);
|
||||
|
||||
num_read = intfstream_read(coro->stream, (void*)ptr, to_read);
|
||||
if (num_read <= 0)
|
||||
break;
|
||||
|
||||
@@ -1268,14 +1293,44 @@ static int rcheevos_iterate(rcheevos_coro_t* coro)
|
||||
CHEEVOS_FREE(coro->stream);
|
||||
}
|
||||
|
||||
/* Use the supported extensions as a hint
|
||||
* to what method we should use. */
|
||||
core_get_system_info(&coro->sysinfo);
|
||||
|
||||
/* Use the selected file's extension to determine which method to use */
|
||||
for (coro->i = 0; coro->i < ARRAY_SIZE(finders); coro->i++)
|
||||
{
|
||||
if (finders[coro->i].ext_hashes)
|
||||
{
|
||||
for (coro->j = 0; finders[coro->i].ext_hashes[coro->j]; coro->j++)
|
||||
{
|
||||
if (finders[coro->i].ext_hashes[coro->j] == coro->ext_hash)
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "testing %s\n", finders[coro->i].name);
|
||||
CORO_GOSUB(finders[coro->i].label);
|
||||
|
||||
if (coro->gameid != 0)
|
||||
goto found;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Use the extensions supported by the core as a hint to what method we should use. */
|
||||
core_get_system_info(&coro->sysinfo);
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "no method for file extension, trying core supported extensions: %s\n", coro->sysinfo.valid_extensions);
|
||||
for (coro->i = 0; coro->i < ARRAY_SIZE(finders); coro->i++)
|
||||
{
|
||||
if (finders[coro->i].ext_hashes)
|
||||
{
|
||||
for (coro->j = 0; finders[coro->i].ext_hashes[coro->j]; coro->j++)
|
||||
{
|
||||
if (finders[coro->i].ext_hashes[coro->j] == coro->ext_hash)
|
||||
break;
|
||||
}
|
||||
|
||||
/* did we already check this one? */
|
||||
if (finders[coro->i].ext_hashes[coro->j] == coro->ext_hash)
|
||||
continue;
|
||||
|
||||
coro->ext = coro->sysinfo.valid_extensions;
|
||||
|
||||
while (coro->ext)
|
||||
@@ -1298,13 +1353,7 @@ static int rcheevos_iterate(rcheevos_coro_t* coro)
|
||||
{
|
||||
if (finders[coro->i].ext_hashes[coro->j] == hash)
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "testing %s\n",
|
||||
finders[coro->i].name);
|
||||
|
||||
/*
|
||||
* Inputs: CHEEVOS_VAR_INFO
|
||||
* Outputs: CHEEVOS_VAR_GAMEID, the game was found if it's different from 0
|
||||
*/
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "testing %s\n", finders[coro->i].name);
|
||||
CORO_GOSUB(finders[coro->i].label);
|
||||
|
||||
if (coro->gameid != 0)
|
||||
@@ -1318,18 +1367,13 @@ static int rcheevos_iterate(rcheevos_coro_t* coro)
|
||||
}
|
||||
}
|
||||
|
||||
/* Try hashing methods not specifically tied to a file extension */
|
||||
for (coro->i = 0; coro->i < ARRAY_SIZE(finders); coro->i++)
|
||||
{
|
||||
if (finders[coro->i].ext_hashes)
|
||||
continue;
|
||||
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "testing %s\n",
|
||||
finders[coro->i].name);
|
||||
|
||||
/*
|
||||
* Inputs: CHEEVOS_VAR_INFO
|
||||
* Outputs: CHEEVOS_VAR_GAMEID
|
||||
*/
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "testing %s\n", finders[coro->i].name);
|
||||
CORO_GOSUB(finders[coro->i].label);
|
||||
|
||||
if (coro->gameid != 0)
|
||||
@@ -1432,11 +1476,12 @@ found:
|
||||
CORO_GOSUB(RCHEEVOS_GET_BADGES);
|
||||
CORO_STOP();
|
||||
|
||||
/**************************************************************************
|
||||
* Info Tries to identify a SNES game
|
||||
* Input CHEEVOS_VAR_INFO the content info
|
||||
* Output CHEEVOS_VAR_GAMEID the Retro Achievements game ID, or 0 if not found
|
||||
*************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
* Info Tries to identify a SNES game
|
||||
* Input CHEEVOS_VAR_INFO the content info
|
||||
* Output CHEEVOS_VAR_GAMEID the Retro Achievements game ID, or 0 if not found
|
||||
*************************************************************************/
|
||||
CORO_SUB(RCHEEVOS_SNES_MD5)
|
||||
MD5_Init(&coro->md5);
|
||||
|
||||
@@ -1444,6 +1489,7 @@ found:
|
||||
Unheadered files fall back to RCHEEVOS_GENERIC_MD5. */
|
||||
if (coro->len < 0x2000 || coro->len % 0x2000 != snes_header_len)
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "could not locate SNES header\n", coro->gameid);
|
||||
coro->gameid = 0;
|
||||
CORO_RET();
|
||||
}
|
||||
@@ -1456,41 +1502,12 @@ found:
|
||||
|
||||
CORO_GOTO(RCHEEVOS_GET_GAMEID);
|
||||
|
||||
/**************************************************************************
|
||||
* Info Tries to identify a Genesis game
|
||||
* Input CHEEVOS_VAR_INFO the content info
|
||||
* Output CHEEVOS_VAR_GAMEID the Retro Achievements game ID, or 0 if not found
|
||||
*************************************************************************/
|
||||
CORO_SUB(RCHEEVOS_GENESIS_MD5)
|
||||
|
||||
MD5_Init(&coro->md5);
|
||||
|
||||
coro->offset = 0;
|
||||
coro->count = 0;
|
||||
CORO_GOSUB(RCHEEVOS_EVAL_MD5);
|
||||
|
||||
if (coro->count == 0)
|
||||
{
|
||||
MD5_Final(coro->hash, &coro->md5);
|
||||
coro->gameid = 0;
|
||||
CORO_RET();
|
||||
}
|
||||
|
||||
if (coro->count < CHEEVOS_MB(6))
|
||||
{
|
||||
coro->offset = 0;
|
||||
coro->count = CHEEVOS_MB(6) - coro->count;
|
||||
CORO_GOSUB(RCHEEVOS_FILL_MD5);
|
||||
}
|
||||
|
||||
MD5_Final(coro->hash, &coro->md5);
|
||||
CORO_GOTO(RCHEEVOS_GET_GAMEID);
|
||||
|
||||
/**************************************************************************
|
||||
* Info Tries to identify an Atari Lynx game
|
||||
* Input CHEEVOS_VAR_INFO the content info
|
||||
* Output CHEEVOS_VAR_GAMEID the Retro Achievements game ID, or 0 if not found
|
||||
*************************************************************************/
|
||||
/**************************************************************************
|
||||
* Info Tries to identify an Atari Lynx game
|
||||
* Input CHEEVOS_VAR_INFO the content info
|
||||
* Output CHEEVOS_VAR_GAMEID the Retro Achievements game ID, or 0 if not found
|
||||
*************************************************************************/
|
||||
CORO_SUB(RCHEEVOS_LYNX_MD5)
|
||||
|
||||
/* Checks for the existence of a headered Lynx file.
|
||||
@@ -1498,6 +1515,7 @@ found:
|
||||
if (coro->len <= (unsigned)lynx_header_len ||
|
||||
memcmp("LYNX", (void *)coro->data, 5) != 0)
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "could not locate LYNX header\n", coro->gameid);
|
||||
coro->gameid = 0;
|
||||
CORO_RET();
|
||||
}
|
||||
@@ -1510,11 +1528,12 @@ found:
|
||||
MD5_Final(coro->hash, &coro->md5);
|
||||
CORO_GOTO(RCHEEVOS_GET_GAMEID);
|
||||
|
||||
/**************************************************************************
|
||||
* Info Tries to identify a NES game
|
||||
* Input CHEEVOS_VAR_INFO the content info
|
||||
* Output CHEEVOS_VAR_GAMEID the Retro Achievements game ID, or 0 if not found
|
||||
*************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
* Info Tries to identify a NES game
|
||||
* Input CHEEVOS_VAR_INFO the content info
|
||||
* Output CHEEVOS_VAR_GAMEID the Retro Achievements game ID, or 0 if not found
|
||||
*************************************************************************/
|
||||
CORO_SUB(RCHEEVOS_NES_MD5)
|
||||
|
||||
/* Checks for the existence of a headered NES file.
|
||||
@@ -1534,6 +1553,7 @@ found:
|
||||
|| coro->header.id[3] != 0x1a)
|
||||
{
|
||||
coro->gameid = 0;
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "could not locate NES header\n", coro->gameid);
|
||||
CORO_RET();
|
||||
}
|
||||
|
||||
@@ -1545,11 +1565,220 @@ found:
|
||||
MD5_Final(coro->hash, &coro->md5);
|
||||
CORO_GOTO(RCHEEVOS_GET_GAMEID);
|
||||
|
||||
/**************************************************************************
|
||||
* Info Tries to identify a "generic" game
|
||||
* Input CHEEVOS_VAR_INFO the content info
|
||||
* Output CHEEVOS_VAR_GAMEID the Retro Achievements game ID, or 0 if not found
|
||||
*************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
* Info Tries to identify a Sega CD game
|
||||
* Input CHEEVOS_VAR_INFO the content info
|
||||
* Output CHEEVOS_VAR_GAMEID the Retro Achievements game ID, or 0 if not found
|
||||
*************************************************************************/
|
||||
CORO_SUB(RCHEEVOS_SEGACD_MD5)
|
||||
{
|
||||
/* ignore bin files less than 16MB - they're probably a ROM, not a CD */
|
||||
if (coro->ext_hash == 0x0b8861beU && coro->len < CHEEVOS_MB(16))
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "ignoring small BIN file - assuming not CD\n", coro->gameid);
|
||||
coro->gameid = 0;
|
||||
CORO_RET();
|
||||
}
|
||||
|
||||
MD5_Init(&coro->md5);
|
||||
|
||||
/* find the data track - it should be the first one */
|
||||
coro->stream = cdfs_open_data_track(coro->path);
|
||||
if (coro->stream)
|
||||
{
|
||||
/* open the raw CD */
|
||||
if (cdfs_open_file(&coro->cdfp, coro->stream, NULL))
|
||||
{
|
||||
coro->count = 512;
|
||||
free(coro->data);
|
||||
coro->data = (uint8_t*)malloc(coro->count);
|
||||
cdfs_read_file(&coro->cdfp, coro->data, coro->count);
|
||||
coro->len = coro->count;
|
||||
|
||||
CORO_GOSUB(RCHEEVOS_EVAL_MD5);
|
||||
MD5_Final(coro->hash, &coro->md5);
|
||||
|
||||
cdfs_close_file(&coro->cdfp);
|
||||
|
||||
intfstream_close(coro->stream);
|
||||
CHEEVOS_FREE(coro->stream);
|
||||
|
||||
CORO_GOTO(RCHEEVOS_GET_GAMEID);
|
||||
}
|
||||
|
||||
intfstream_close(coro->stream);
|
||||
CHEEVOS_FREE(coro->stream);
|
||||
}
|
||||
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "could not open CD\n", coro->gameid);
|
||||
coro->gameid = 0;
|
||||
CORO_RET();
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* Info Tries to identify a Playstation game
|
||||
* Input CHEEVOS_VAR_INFO the content info
|
||||
* Output CHEEVOS_VAR_GAMEID the Retro Achievements game ID, or 0 if not found
|
||||
*************************************************************************/
|
||||
CORO_SUB(RCHEEVOS_PSX_MD5)
|
||||
{
|
||||
MD5_Init(&coro->md5);
|
||||
|
||||
/* if we're looking at an m3u file, get the first disc from the playlist */
|
||||
end = path_get_extension(coro->path);
|
||||
if (string_is_equal_noncase(end, "m3u"))
|
||||
{
|
||||
intfstream_t* m3u_stream = intfstream_open_file(coro->path, RETRO_VFS_FILE_ACCESS_READ, RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
if (m3u_stream)
|
||||
{
|
||||
char disc_path[PATH_MAX_LENGTH];
|
||||
char* tmp;
|
||||
|
||||
num_read = intfstream_read(m3u_stream, buffer, sizeof(buffer));
|
||||
intfstream_close(m3u_stream);
|
||||
buffer[num_read] = '\0';
|
||||
|
||||
tmp = buffer;
|
||||
while (*tmp && *tmp != '\n')
|
||||
++tmp;
|
||||
if (tmp > buffer && tmp[-1] == '\r')
|
||||
--tmp;
|
||||
*tmp = '\0';
|
||||
|
||||
fill_pathname_basedir(disc_path, coro->path, sizeof(disc_path));
|
||||
strlcat(disc_path, buffer, sizeof(disc_path));
|
||||
|
||||
free((void*)coro->path);
|
||||
coro->path = strdup(disc_path);
|
||||
}
|
||||
}
|
||||
|
||||
/* find the data track - it should be the first one */
|
||||
coro->stream = cdfs_open_data_track(coro->path);
|
||||
if (coro->stream)
|
||||
{
|
||||
/* open the SYSTEM.CNF file and find the BOOT= record */
|
||||
if (cdfs_open_file(&coro->cdfp, coro->stream, "SYSTEM.CNF"))
|
||||
{
|
||||
cdfs_read_file(&coro->cdfp, buffer, sizeof(buffer));
|
||||
|
||||
for (scan = buffer; scan < &buffer[sizeof(buffer)] && *scan; ++scan)
|
||||
{
|
||||
if (strncmp(scan, "BOOT", 4) == 0)
|
||||
{
|
||||
exe_name = scan + 4;
|
||||
while (isspace(*exe_name))
|
||||
++exe_name;
|
||||
if (*exe_name == '=')
|
||||
{
|
||||
++exe_name;
|
||||
while (isspace(*exe_name))
|
||||
++exe_name;
|
||||
|
||||
if (strncmp(exe_name, "cdrom:", 6) == 0)
|
||||
exe_name += 6;
|
||||
if (*exe_name == '\\')
|
||||
++exe_name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
while (*scan && *scan != '\n')
|
||||
++scan;
|
||||
}
|
||||
|
||||
cdfs_close_file(&coro->cdfp);
|
||||
|
||||
if (exe_name)
|
||||
{
|
||||
scan = exe_name;
|
||||
while (*scan != '\n' && *scan != '\r' && *scan != ';' && *scan != ' ')
|
||||
++scan;
|
||||
*scan = '\0';
|
||||
|
||||
exe_name_size = scan - exe_name;
|
||||
if (exe_name_size < sizeof(exe_name_buffer))
|
||||
strcpy(exe_name_buffer, exe_name);
|
||||
|
||||
/* open the file pointed to by the BOOT= record */
|
||||
if (exe_name_buffer[0] && cdfs_open_file(&coro->cdfp, coro->stream, exe_name_buffer))
|
||||
{
|
||||
cdfs_read_file(&coro->cdfp, buffer, sizeof(buffer));
|
||||
|
||||
/* the PSX-E header specifies the executable size as a 4-byte value 28 bytes into the header, which doesn't
|
||||
* include the header itself. We want to include the header in the hash, so append another 2048 to that value.
|
||||
* ASSERT: this results in the same value as coro->cdfp->size */
|
||||
coro->count = 2048 + (((uint8_t)buffer[28 + 3] << 24) | ((uint8_t)buffer[28 + 2] << 16) |
|
||||
((uint8_t)buffer[28 + 1] << 8) | (uint8_t)buffer[28]);
|
||||
|
||||
if (coro->count > CHEEVOS_MB(16)) /* sanity check */
|
||||
{
|
||||
cdfs_close_file(&coro->cdfp);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* there's a few games that are use a singular engine and only differ via their data files.
|
||||
* luckily, they have unique serial numbers, and use the serial number as the boot file in the
|
||||
* standard way. include the boot executable name in the hash */
|
||||
coro->count += exe_name_size;
|
||||
|
||||
free(coro->data);
|
||||
coro->data = (uint8_t*)malloc(coro->count);
|
||||
memcpy(coro->data, exe_name_buffer, exe_name_size);
|
||||
coro->len = exe_name_size;
|
||||
|
||||
memcpy((uint8_t*)coro->data + coro->len, buffer, sizeof(buffer));
|
||||
coro->len += sizeof(buffer);
|
||||
|
||||
while (coro->len < coro->count)
|
||||
{
|
||||
CORO_YIELD();
|
||||
|
||||
to_read = coro->count - coro->len;
|
||||
if (to_read > 2048)
|
||||
to_read = 2048;
|
||||
|
||||
cdfs_read_file(&coro->cdfp, (uint8_t*)coro->data + coro->len, to_read);
|
||||
|
||||
coro->len += to_read;
|
||||
};
|
||||
|
||||
CORO_GOSUB(RCHEEVOS_EVAL_MD5);
|
||||
MD5_Final(coro->hash, &coro->md5);
|
||||
|
||||
cdfs_close_file(&coro->cdfp);
|
||||
|
||||
intfstream_close(coro->stream);
|
||||
CHEEVOS_FREE(coro->stream);
|
||||
|
||||
CORO_GOTO(RCHEEVOS_GET_GAMEID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "could not locate primary executable\n", coro->gameid);
|
||||
|
||||
intfstream_close(coro->stream);
|
||||
CHEEVOS_FREE(coro->stream);
|
||||
}
|
||||
else
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "could not open CD\n", coro->gameid);
|
||||
}
|
||||
|
||||
coro->gameid = 0;
|
||||
CORO_RET();
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* Info Tries to identify a game by examining the entire file (no special processing)
|
||||
* Input CHEEVOS_VAR_INFO the content info
|
||||
* Output CHEEVOS_VAR_GAMEID the Retro Achievements game ID, or 0 if not found
|
||||
*************************************************************************/
|
||||
CORO_SUB(RCHEEVOS_GENERIC_MD5)
|
||||
|
||||
MD5_Init(&coro->md5);
|
||||
@@ -1565,12 +1794,14 @@ found:
|
||||
|
||||
CORO_GOTO(RCHEEVOS_GET_GAMEID);
|
||||
|
||||
/**************************************************************************
|
||||
* Info Tries to identify a game based on its filename (with no extension)
|
||||
* Input CHEEVOS_VAR_INFO the content info
|
||||
* Output CHEEVOS_VAR_GAMEID the Retro Achievements game ID, or 0 if not found
|
||||
*************************************************************************/
|
||||
CORO_SUB(RCHEEVOS_FILENAME_MD5)
|
||||
|
||||
/**************************************************************************
|
||||
* Info Tries to identify an arcade game based on its filename (with no extension).
|
||||
* An arcade game "rom" is a zip file containing many ROMs.
|
||||
* Input CHEEVOS_VAR_INFO the content info
|
||||
* Output CHEEVOS_VAR_GAMEID the Retro Achievements game ID, or 0 if not found
|
||||
*************************************************************************/
|
||||
CORO_SUB(RCHEEVOS_ARCADE_MD5)
|
||||
if (!string_is_empty(coro->path))
|
||||
{
|
||||
char base_noext[PATH_MAX_LENGTH];
|
||||
@@ -1584,11 +1815,12 @@ found:
|
||||
}
|
||||
CORO_RET();
|
||||
|
||||
/**************************************************************************
|
||||
* Info Evaluates the CHEEVOS_VAR_MD5 hash
|
||||
* Inputs CHEEVOS_VAR_INFO, CHEEVOS_VAR_OFFSET, CHEEVOS_VAR_COUNT
|
||||
* Outputs CHEEVOS_VAR_MD5, CHEEVOS_VAR_COUNT
|
||||
*************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
* Info Evaluates the CHEEVOS_VAR_MD5 hash
|
||||
* Inputs CHEEVOS_VAR_INFO, CHEEVOS_VAR_OFFSET, CHEEVOS_VAR_COUNT
|
||||
* Outputs CHEEVOS_VAR_MD5, CHEEVOS_VAR_COUNT
|
||||
*************************************************************************/
|
||||
CORO_SUB(RCHEEVOS_EVAL_MD5)
|
||||
|
||||
if (coro->count == 0)
|
||||
@@ -1606,40 +1838,24 @@ found:
|
||||
coro->count);
|
||||
CORO_RET();
|
||||
|
||||
/**************************************************************************
|
||||
* Info Updates the CHEEVOS_VAR_MD5 hash with a repeated value
|
||||
* Inputs CHEEVOS_VAR_OFFSET, CHEEVOS_VAR_COUNT
|
||||
* Outputs CHEEVOS_VAR_MD5
|
||||
*************************************************************************/
|
||||
CORO_SUB(RCHEEVOS_FILL_MD5)
|
||||
|
||||
{
|
||||
char buffer[4096];
|
||||
|
||||
while (coro->count > 0)
|
||||
{
|
||||
size_t len = sizeof(buffer);
|
||||
|
||||
if (len > coro->count)
|
||||
len = coro->count;
|
||||
|
||||
memset((void*)buffer, coro->offset, len);
|
||||
MD5_Update(&coro->md5, (void*)buffer, len);
|
||||
coro->count -= len;
|
||||
}
|
||||
}
|
||||
|
||||
CORO_RET();
|
||||
|
||||
/**************************************************************************
|
||||
* Info Gets the achievements from Retro Achievements
|
||||
* Inputs coro->hash
|
||||
* Outputs CHEEVOS_VAR_GAMEID
|
||||
*************************************************************************/
|
||||
/**************************************************************************
|
||||
* Info Gets the achievements from Retro Achievements
|
||||
* Inputs coro->hash
|
||||
* Outputs CHEEVOS_VAR_GAMEID
|
||||
*************************************************************************/
|
||||
CORO_SUB(RCHEEVOS_GET_GAMEID)
|
||||
|
||||
{
|
||||
int size;
|
||||
|
||||
if (memcmp(coro->last_hash, coro->hash, sizeof(coro->hash)) == 0)
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "hash did not change, returning %u\n", coro->gameid);
|
||||
CORO_RET();
|
||||
}
|
||||
memcpy(coro->last_hash, coro->hash, sizeof(coro->hash));
|
||||
|
||||
size = rc_url_get_gameid(coro->url, sizeof(coro->url), coro->hash);
|
||||
|
||||
if (size < 0)
|
||||
@@ -1648,6 +1864,11 @@ found:
|
||||
CORO_RET();
|
||||
}
|
||||
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "checking %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
|
||||
coro->hash[0], coro->hash[1], coro->hash[2], coro->hash[3],
|
||||
coro->hash[4], coro->hash[5], coro->hash[6], coro->hash[7],
|
||||
coro->hash[8], coro->hash[9], coro->hash[10], coro->hash[11],
|
||||
coro->hash[12], coro->hash[13], coro->hash[14], coro->hash[15]);
|
||||
rcheevos_log_url(RCHEEVOS_TAG "rc_url_get_gameid: %s\n", coro->url);
|
||||
CORO_GOSUB(RCHEEVOS_HTTP_GET);
|
||||
|
||||
@@ -1661,11 +1882,12 @@ found:
|
||||
CORO_RET();
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* Info Gets the achievements from Retro Achievements
|
||||
* Inputs CHEEVOS_VAR_GAMEID
|
||||
* Outputs CHEEVOS_VAR_JSON
|
||||
*************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
* Info Gets the achievements from Retro Achievements
|
||||
* Inputs CHEEVOS_VAR_GAMEID
|
||||
* Outputs CHEEVOS_VAR_JSON
|
||||
*************************************************************************/
|
||||
CORO_SUB(RCHEEVOS_GET_CHEEVOS)
|
||||
{
|
||||
int ret;
|
||||
@@ -1693,11 +1915,12 @@ found:
|
||||
CORO_RET();
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* Info Gets the achievements from Retro Achievements
|
||||
* Inputs CHEEVOS_VAR_GAMEID
|
||||
* Outputs CHEEVOS_VAR_JSON
|
||||
*************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
* Info Gets the achievements from Retro Achievements
|
||||
* Inputs CHEEVOS_VAR_GAMEID
|
||||
* Outputs CHEEVOS_VAR_JSON
|
||||
*************************************************************************/
|
||||
CORO_SUB(RCHEEVOS_GET_BADGES)
|
||||
|
||||
badges_ctx = new_badges_ctx;
|
||||
@@ -1788,9 +2011,10 @@ found:
|
||||
|
||||
CORO_RET();
|
||||
|
||||
/**************************************************************************
|
||||
* Info Logs in the user at Retro Achievements
|
||||
*************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
* Info Logs in the user at Retro Achievements
|
||||
*************************************************************************/
|
||||
CORO_SUB(RCHEEVOS_LOGIN)
|
||||
{
|
||||
const char* username;
|
||||
@@ -1880,9 +2104,10 @@ found:
|
||||
CORO_RET();
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* Info Pauses execution for five seconds
|
||||
*************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
* Info Pauses execution for five seconds
|
||||
*************************************************************************/
|
||||
CORO_SUB(RCHEEVOS_DELAY)
|
||||
|
||||
{
|
||||
@@ -1898,11 +2123,12 @@ found:
|
||||
|
||||
CORO_RET();
|
||||
|
||||
/**************************************************************************
|
||||
* Info Makes a HTTP GET request
|
||||
* Inputs CHEEVOS_VAR_URL
|
||||
* Outputs CHEEVOS_VAR_JSON
|
||||
*************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
* Info Makes a HTTP GET request
|
||||
* Inputs CHEEVOS_VAR_URL
|
||||
* Outputs CHEEVOS_VAR_JSON
|
||||
*************************************************************************/
|
||||
CORO_SUB(RCHEEVOS_HTTP_GET)
|
||||
|
||||
for (coro->k = 0; coro->k < 5; coro->k++)
|
||||
@@ -1973,11 +2199,12 @@ found:
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "Couldn't connect to server after 5 tries\n");
|
||||
CORO_RET();
|
||||
|
||||
/**************************************************************************
|
||||
* Info Deactivates the achievements already awarded
|
||||
* Inputs CHEEVOS_VAR_GAMEID
|
||||
* Outputs
|
||||
*************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
* Info Deactivates the achievements already awarded
|
||||
* Inputs CHEEVOS_VAR_GAMEID
|
||||
* Outputs
|
||||
*************************************************************************/
|
||||
CORO_SUB(RCHEEVOS_DEACTIVATE)
|
||||
|
||||
CORO_GOSUB(RCHEEVOS_LOGIN);
|
||||
@@ -1985,6 +2212,7 @@ found:
|
||||
int ret;
|
||||
unsigned mode;
|
||||
|
||||
/* Two calls - one for softcore and one for hardcore */
|
||||
for (coro->i = 0; coro->i < 2; coro->i++)
|
||||
{
|
||||
ret = rc_url_get_unlock_list(coro->url, sizeof(coro->url), coro->settings->arrays.cheevos_username, rcheevos_locals.token, coro->gameid, coro->i);
|
||||
@@ -2011,11 +2239,12 @@ found:
|
||||
|
||||
CORO_RET();
|
||||
|
||||
/**************************************************************************
|
||||
* Info Posts the "playing" activity to Retro Achievements
|
||||
* Inputs CHEEVOS_VAR_GAMEID
|
||||
* Outputs
|
||||
*************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
* Info Posts the "playing" activity to Retro Achievements
|
||||
* Inputs CHEEVOS_VAR_GAMEID
|
||||
* Outputs
|
||||
*************************************************************************/
|
||||
CORO_SUB(RCHEEVOS_PLAYING)
|
||||
|
||||
snprintf(
|
||||
@@ -2038,7 +2267,6 @@ found:
|
||||
else
|
||||
CHEEVOS_ERR(RCHEEVOS_TAG "error posting playing activity\n");
|
||||
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "posted playing activity\n");
|
||||
CORO_RET();
|
||||
|
||||
CORO_LEAVE();
|
||||
@@ -2078,7 +2306,8 @@ bool rcheevos_load(const void *data)
|
||||
{
|
||||
retro_task_t *task;
|
||||
const struct retro_game_info *info = NULL;
|
||||
rcheevos_coro_t *coro = NULL;
|
||||
rcheevos_coro_t *coro = NULL;
|
||||
char buffer[32];
|
||||
|
||||
rcheevos_loaded = false;
|
||||
rcheevos_hardcore_paused = false;
|
||||
@@ -2129,6 +2358,12 @@ bool rcheevos_load(const void *data)
|
||||
coro->path = strdup(info->path);
|
||||
}
|
||||
|
||||
strncpy(buffer, path_get_extension(info->path), sizeof(buffer));
|
||||
buffer[sizeof(buffer) - 1] = '\0';
|
||||
string_to_lower(buffer);
|
||||
coro->ext_hash = rcheevos_djb2(buffer, strlen(buffer));
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "ext_hash %08x ('%s')\n", coro->ext_hash, buffer);
|
||||
|
||||
task->handler = rcheevos_task_handler;
|
||||
task->state = (void*)coro;
|
||||
task->mute = true;
|
||||
|
||||
+53
-19
@@ -93,6 +93,10 @@
|
||||
#define DEFAULT_MAX_PADS 16
|
||||
#endif
|
||||
|
||||
#if defined(GEKKO)
|
||||
#define DEFAULT_MOUSE_SCALE 1
|
||||
#endif
|
||||
|
||||
#if defined(RARCH_MOBILE) || defined(HAVE_LIBNX)
|
||||
#define DEFAULT_POINTER_ENABLE true
|
||||
#else
|
||||
@@ -110,9 +114,33 @@
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MATERIALUI
|
||||
/* Show icons to the left of each menu entry */
|
||||
#define DEFAULT_MATERIALUI_ICONS_ENABLE true
|
||||
#endif
|
||||
|
||||
/* Material UI colour theme */
|
||||
#define DEFAULT_MATERIALUI_THEME MATERIALUI_THEME_OZONE_DARK
|
||||
|
||||
/* Type of animation to use when performing menu transitions
|
||||
* > 'Auto' follows Material UI standards:
|
||||
* - Slide when switching between parent menus (tabs)
|
||||
* - Fade when changing levels in a menu
|
||||
* Note: Not wrapping this with a HAVE_MATERIALUI ifdef
|
||||
* because there's too much baggage involved... */
|
||||
#define DEFAULT_MATERIALUI_TRANSITION_ANIM MATERIALUI_TRANSITION_ANIM_AUTO
|
||||
|
||||
/* Adjust menu padding etc. to better fit the
|
||||
* screen when using landscape layouts */
|
||||
#if defined(RARCH_MOBILE)
|
||||
#define DEFAULT_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT false
|
||||
#else
|
||||
#define DEFAULT_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT true
|
||||
#endif
|
||||
|
||||
/* Reposition navigation bar to make better use
|
||||
* of screen space when using landscape layouts */
|
||||
#define DEFAULT_MATERIALUI_AUTO_ROTATE_NAV_BAR true
|
||||
|
||||
#define DEFAULT_CRT_SWITCH_RESOLUTION CRT_SWITCH_NONE
|
||||
|
||||
#define DEFAULT_CRT_SWITCH_RESOLUTION_SUPER 2560
|
||||
@@ -123,6 +151,8 @@
|
||||
|
||||
#define DEFAULT_PLAYLIST_ENTRY_RENAME true
|
||||
|
||||
#define DEFAULT_DRIVER_SWITCH_ENABLE true
|
||||
|
||||
#define DEFAULT_USER_LANGUAGE 0
|
||||
|
||||
#if (defined(_WIN32) && !defined(_XBOX)) || (defined(__linux) && !defined(ANDROID) && !defined(HAVE_LAKKA)) || (defined(__MACH__) && !defined(IOS)) || defined(EMSCRIPTEN)
|
||||
@@ -293,12 +323,7 @@
|
||||
|
||||
#if defined(__CELLOS_LV2) || defined(_XBOX360)
|
||||
#define DEFAULT_ASPECT_RATIO_IDX ASPECT_RATIO_16_9
|
||||
#elif defined(PSP)
|
||||
#define DEFAULT_ASPECT_RATIO_IDX ASPECT_RATIO_CORE
|
||||
#elif defined(_3DS)
|
||||
/* Previously defaulted to ASPECT_RATIO_4_3.
|
||||
* Non-4:3 content looks dreadful when stretched
|
||||
* to 4:3 on the 3DS screen... */
|
||||
#elif defined(PSP) || defined(_3DS) || defined(HAVE_LIBNX) || defined(VITA)
|
||||
#define DEFAULT_ASPECT_RATIO_IDX ASPECT_RATIO_CORE
|
||||
#elif defined(RARCH_CONSOLE)
|
||||
#define DEFAULT_ASPECT_RATIO_IDX ASPECT_RATIO_4_3
|
||||
@@ -322,6 +347,12 @@
|
||||
#define DEFAULT_INPUT_OVERLAY_OPACITY 0.7f
|
||||
#endif
|
||||
|
||||
#if defined(RARCH_MOBILE)
|
||||
#define DEFAULT_OVERLAY_AUTO_ROTATE true
|
||||
#else
|
||||
#define DEFAULT_OVERLAY_AUTO_ROTATE false
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#include "menu/menu_driver.h"
|
||||
#include "menu/menu_animation.h"
|
||||
@@ -335,6 +366,7 @@
|
||||
#ifdef HAVE_OZONE
|
||||
#define DEFAULT_OZONE_COLLAPSE_SIDEBAR false
|
||||
#define DEFAULT_OZONE_TRUNCATE_PLAYLIST_NAME true
|
||||
#define DEFAULT_OZONE_SCROLL_CONTENT_METADATA false
|
||||
#endif
|
||||
|
||||
#define DEFAULT_SETTINGS_SHOW_DRIVERS true
|
||||
@@ -407,7 +439,8 @@ static bool quick_menu_show_download_thumbnails = true;
|
||||
|
||||
static bool kiosk_mode_enable = false;
|
||||
|
||||
static bool menu_horizontal_animation = true;
|
||||
#define DEFAULT_MENU_HORIZONTAL_ANIMATION true
|
||||
|
||||
static bool menu_show_online_updater = true;
|
||||
static bool menu_show_load_core = true;
|
||||
static bool menu_show_load_content = true;
|
||||
@@ -460,7 +493,6 @@ static bool content_show_add = true;
|
||||
static bool content_show_playlists = true;
|
||||
|
||||
#ifdef HAVE_XMB
|
||||
static unsigned xmb_scale_factor = 100;
|
||||
static unsigned xmb_alpha_factor = 75;
|
||||
static unsigned menu_font_color_red = 255;
|
||||
static unsigned menu_font_color_green = 255;
|
||||
@@ -514,7 +546,8 @@ static bool rgui_extended_ascii = false;
|
||||
#define DEFAULT_BLOCK_CONFIG_READ false
|
||||
#endif
|
||||
|
||||
#define DEFAULT_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST true
|
||||
/* TODO/FIXME - this setting is thread-unsafe right now and can corrupt the stack - default to off */
|
||||
#define DEFAULT_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST false
|
||||
|
||||
static bool default_game_specific_options = true;
|
||||
static bool default_auto_overrides_enable = true;
|
||||
@@ -861,6 +894,9 @@ static const unsigned playlist_show_inline_core_name = PLAYLIST_INLINE_CORE_DISP
|
||||
/* Specifies which runtime record to use on playlist sublabels */
|
||||
static const unsigned playlist_sublabel_runtime_type = PLAYLIST_RUNTIME_PER_CORE;
|
||||
|
||||
/* Specifies time/date display format for runtime 'last played' data */
|
||||
#define DEFAULT_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE PLAYLIST_LAST_PLAYED_STYLE_YMD_HMS
|
||||
|
||||
static const unsigned playlist_entry_remove_enable = PLAYLIST_ENTRY_REMOVE_ENABLE_ALL;
|
||||
#endif
|
||||
|
||||
@@ -879,15 +915,9 @@ static const bool playlist_fuzzy_archive_match = false;
|
||||
/* Show Menu start-up screen on boot. */
|
||||
static const bool default_menu_show_start_screen = true;
|
||||
|
||||
#define DEFAULT_MENU_DPI_OVERRIDE_ENABLE false
|
||||
|
||||
#ifdef RARCH_MOBILE
|
||||
#define DEFAULT_MENU_DPI_OVERRIDE_VALUE 72
|
||||
#elif defined(__CELLOS_LV2__)
|
||||
#define DEFAULT_MENU_DPI_OVERRIDE_VALUE 360
|
||||
#else
|
||||
#define DEFAULT_MENU_DPI_OVERRIDE_VALUE 200
|
||||
#endif
|
||||
/* Default scale factor for non-frambuffer-based menu
|
||||
* drivers and menu widgets */
|
||||
#define DEFAULT_MENU_SCALE_FACTOR 1.0f
|
||||
|
||||
/* Log level for the frontend */
|
||||
#define DEFAULT_FRONTEND_LOG_LEVEL 1
|
||||
@@ -941,7 +971,9 @@ static const unsigned menu_left_thumbnails_default = 0;
|
||||
|
||||
static const unsigned menu_thumbnail_upscale_threshold = 0;
|
||||
|
||||
static const unsigned menu_timedate_style = 5;
|
||||
#ifdef HAVE_MENU
|
||||
static const unsigned menu_timedate_style = MENU_TIMEDATE_STYLE_DM_HM;
|
||||
#endif
|
||||
|
||||
static const bool xmb_vertical_thumbnails = false;
|
||||
|
||||
@@ -1113,6 +1145,8 @@ static char default_discord_app_id[] = "475456035851599874";
|
||||
|
||||
#define DEFAULT_AI_SERVICE_ENABLE true
|
||||
|
||||
#define DEFAULT_AI_SERVICE_PAUSE false
|
||||
|
||||
#define DEFAULT_AI_SERVICE_MODE 1
|
||||
|
||||
#define DEFAULT_AI_SERVICE_URL "http://localhost:4404/"
|
||||
|
||||
+40
-63
@@ -166,6 +166,7 @@ enum video_driver_enum
|
||||
VIDEO_CACA,
|
||||
VIDEO_GDI,
|
||||
VIDEO_VGA,
|
||||
VIDEO_FPGA,
|
||||
VIDEO_NULL
|
||||
};
|
||||
|
||||
@@ -364,6 +365,8 @@ static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SDL2;
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_GDI;
|
||||
#elif defined(DJGPP)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_VGA;
|
||||
#elif defined(HAVE_FPGA)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_FPGA;
|
||||
#elif defined(HAVE_DYLIB) && !defined(ANDROID)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_EXT;
|
||||
#else
|
||||
@@ -400,7 +403,7 @@ static enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_AUDIOIO;
|
||||
static enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_OSS;
|
||||
#elif defined(HAVE_JACK)
|
||||
static enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_JACK;
|
||||
#elif defined(HAVE_COREAUDIO)
|
||||
#elif defined(HAVE_COREAUDIO) && !defined(HAVE_COCOA_METAL)
|
||||
static enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_COREAUDIO;
|
||||
#elif defined(HAVE_COREAUDIO3)
|
||||
static enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_COREAUDIO3;
|
||||
@@ -444,7 +447,7 @@ static enum record_driver_enum RECORD_DEFAULT_DRIVER = RECORD_NULL;
|
||||
|
||||
#ifdef HAVE_WINMM
|
||||
static enum midi_driver_enum MIDI_DEFAULT_DRIVER = MIDI_WINMM;
|
||||
#elif defined(HAVE_ALSA) && !defined(HAVE_HAKCHI)
|
||||
#elif defined(HAVE_ALSA) && !defined(HAVE_HAKCHI) && !defined(HAVE_SEGAM)
|
||||
static enum midi_driver_enum MIDI_DEFAULT_DRIVER = MIDI_ALSA;
|
||||
#else
|
||||
static enum midi_driver_enum MIDI_DEFAULT_DRIVER = MIDI_NULL;
|
||||
@@ -696,7 +699,7 @@ const char *config_get_default_audio(void)
|
||||
return "dsp";
|
||||
case AUDIO_SWITCH:
|
||||
#if defined(HAVE_LIBNX)
|
||||
return "switch_thread";
|
||||
return "switch_audren_thread";
|
||||
#else
|
||||
return "switch";
|
||||
#endif
|
||||
@@ -827,6 +830,8 @@ const char *config_get_default_video(void)
|
||||
return "gdi";
|
||||
case VIDEO_VGA:
|
||||
return "vga";
|
||||
case VIDEO_FPGA:
|
||||
return "fpga";
|
||||
case VIDEO_NULL:
|
||||
break;
|
||||
}
|
||||
@@ -1325,6 +1330,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
struct config_bool_setting *tmp = (struct config_bool_setting*)calloc(1, (*size + 1) * sizeof(struct config_bool_setting));
|
||||
unsigned count = 0;
|
||||
|
||||
SETTING_BOOL("driver_switch_enable", &settings->bools.driver_switch_enable, true, DEFAULT_DRIVER_SWITCH_ENABLE, false);
|
||||
SETTING_BOOL("frame_time_counter_reset_after_fastforwarding", &settings->bools.frame_time_counter_reset_after_fastforwarding, true, false, false);
|
||||
SETTING_BOOL("frame_time_counter_reset_after_load_state", &settings->bools.frame_time_counter_reset_after_load_state, true, false, false);
|
||||
SETTING_BOOL("frame_time_counter_reset_after_save_state", &settings->bools.frame_time_counter_reset_after_save_state, true, false, false);
|
||||
@@ -1445,8 +1451,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
SETTING_BOOL("menu_unified_controls", &settings->bools.menu_unified_controls, true, false, false);
|
||||
SETTING_BOOL("menu_throttle_framerate", &settings->bools.menu_throttle_framerate, true, true, false);
|
||||
SETTING_BOOL("menu_linear_filter", &settings->bools.menu_linear_filter, true, true, false);
|
||||
SETTING_BOOL("menu_horizontal_animation", &settings->bools.menu_horizontal_animation, true, true, false);
|
||||
SETTING_BOOL("dpi_override_enable", &settings->bools.menu_dpi_override_enable, true, DEFAULT_MENU_DPI_OVERRIDE_ENABLE, false);
|
||||
SETTING_BOOL("menu_horizontal_animation", &settings->bools.menu_horizontal_animation, true, DEFAULT_MENU_HORIZONTAL_ANIMATION, false);
|
||||
SETTING_BOOL("menu_pause_libretro", &settings->bools.menu_pause_libretro, true, true, false);
|
||||
SETTING_BOOL("menu_savestate_resume", &settings->bools.menu_savestate_resume, true, menu_savestate_resume, false);
|
||||
SETTING_BOOL("menu_mouse_enable", &settings->bools.menu_mouse_enable, true, DEFAULT_MOUSE_ENABLE, false);
|
||||
@@ -1551,6 +1556,8 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
SETTING_BOOL("menu_show_advanced_settings", &settings->bools.menu_show_advanced_settings, true, DEFAULT_SHOW_ADVANCED_SETTINGS, false);
|
||||
#ifdef HAVE_MATERIALUI
|
||||
SETTING_BOOL("materialui_icons_enable", &settings->bools.menu_materialui_icons_enable, true, DEFAULT_MATERIALUI_ICONS_ENABLE, false);
|
||||
SETTING_BOOL("materialui_optimize_landscape_layout", &settings->bools.menu_materialui_optimize_landscape_layout, true, DEFAULT_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT, false);
|
||||
SETTING_BOOL("materialui_auto_rotate_nav_bar", &settings->bools.menu_materialui_auto_rotate_nav_bar, true, DEFAULT_MATERIALUI_AUTO_ROTATE_NAV_BAR, false);
|
||||
#endif
|
||||
#ifdef HAVE_RGUI
|
||||
SETTING_BOOL("rgui_background_filler_thickness_enable", &settings->bools.menu_rgui_background_filler_thickness_enable, true, true, false);
|
||||
@@ -1584,6 +1591,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
SETTING_BOOL("input_overlay_show_physical_inputs", &settings->bools.input_overlay_show_physical_inputs, true, false, false);
|
||||
SETTING_BOOL("input_overlay_hide_in_menu", &settings->bools.input_overlay_hide_in_menu, true, DEFAULT_OVERLAY_HIDE_IN_MENU, false);
|
||||
SETTING_BOOL("input_overlay_show_mouse_cursor", &settings->bools.input_overlay_show_mouse_cursor, true, DEFAULT_OVERLAY_SHOW_MOUSE_CURSOR, false);
|
||||
SETTING_BOOL("input_overlay_auto_rotate", &settings->bools.input_overlay_auto_rotate, true, DEFAULT_OVERLAY_AUTO_ROTATE, false);
|
||||
#endif
|
||||
#ifdef HAVE_VIDEO_LAYOUT
|
||||
SETTING_BOOL("video_layout_enable", &settings->bools.video_layout_enable, true, true, false);
|
||||
@@ -1651,11 +1659,13 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
#ifdef HAVE_OZONE
|
||||
SETTING_BOOL("ozone_collapse_sidebar", &settings->bools.ozone_collapse_sidebar, true, DEFAULT_OZONE_COLLAPSE_SIDEBAR, false);
|
||||
SETTING_BOOL("ozone_truncate_playlist_name", &settings->bools.ozone_truncate_playlist_name, true, DEFAULT_OZONE_TRUNCATE_PLAYLIST_NAME, false);
|
||||
SETTING_BOOL("ozone_scroll_content_metadata",&settings->bools.ozone_scroll_content_metadata, true, DEFAULT_OZONE_SCROLL_CONTENT_METADATA, false);
|
||||
#endif
|
||||
SETTING_BOOL("log_to_file", &settings->bools.log_to_file, true, DEFAULT_LOG_TO_FILE, false);
|
||||
SETTING_OVERRIDE(RARCH_OVERRIDE_SETTING_LOG_TO_FILE);
|
||||
SETTING_BOOL("log_to_file_timestamp", &settings->bools.log_to_file_timestamp, true, DEFAULT_LOG_TO_FILE_TIMESTAMP, false);
|
||||
SETTING_BOOL("ai_service_enable", &settings->bools.ai_service_enable, DEFAULT_AI_SERVICE_ENABLE, false, false);
|
||||
SETTING_BOOL("ai_service_pause", &settings->bools.ai_service_pause, true, DEFAULT_AI_SERVICE_PAUSE, false);
|
||||
|
||||
*size = count;
|
||||
|
||||
@@ -1685,6 +1695,7 @@ static struct config_float_setting *populate_settings_float(settings_t *settings
|
||||
SETTING_FLOAT("input_overlay_scale", &settings->floats.input_overlay_scale, true, 1.0f, false);
|
||||
#endif
|
||||
#ifdef HAVE_MENU
|
||||
SETTING_FLOAT("menu_scale_factor", &settings->floats.menu_scale_factor, true, DEFAULT_MENU_SCALE_FACTOR, false);
|
||||
SETTING_FLOAT("menu_wallpaper_opacity", &settings->floats.menu_wallpaper_opacity, true, menu_wallpaper_opacity, false);
|
||||
SETTING_FLOAT("menu_framebuffer_opacity", &settings->floats.menu_framebuffer_opacity, true, menu_framebuffer_opacity, false);
|
||||
SETTING_FLOAT("menu_footer_opacity", &settings->floats.menu_footer_opacity, true, menu_footer_opacity, false);
|
||||
@@ -1726,6 +1737,9 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
SETTING_UINT("input_max_users", input_driver_get_uint(INPUT_ACTION_MAX_USERS), true, input_max_users, false);
|
||||
SETTING_UINT("fps_update_interval", &settings->uints.fps_update_interval, true, DEFAULT_FPS_UPDATE_INTERVAL, false);
|
||||
SETTING_UINT("input_menu_toggle_gamepad_combo", &settings->uints.input_menu_toggle_gamepad_combo, true, menu_toggle_gamepad_combo, false);
|
||||
#ifdef GEKKO
|
||||
SETTING_UINT("input_mouse_scale", &settings->uints.input_mouse_scale, true, DEFAULT_MOUSE_SCALE, false);
|
||||
#endif
|
||||
SETTING_UINT("audio_latency", &settings->uints.audio_latency, false, 0 /* TODO */, false);
|
||||
SETTING_UINT("audio_resampler_quality", &settings->uints.audio_resampler_quality, true, audio_resampler_quality_level, false);
|
||||
SETTING_UINT("audio_block_frames", &settings->uints.audio_block_frames, true, 0, false);
|
||||
@@ -1759,7 +1773,6 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
SETTING_UINT("video_overscan_correction_bottom", &settings->uints.video_overscan_correction_bottom, true, DEFAULT_VIDEO_OVERSCAN_CORRECTION_BOTTOM, false);
|
||||
#endif
|
||||
#ifdef HAVE_MENU
|
||||
SETTING_UINT("dpi_override_value", &settings->uints.menu_dpi_override_value, true, DEFAULT_MENU_DPI_OVERRIDE_VALUE, false);
|
||||
SETTING_UINT("menu_thumbnails", &settings->uints.menu_thumbnails, true, menu_thumbnails_default, false);
|
||||
SETTING_UINT("menu_left_thumbnails", &settings->uints.menu_left_thumbnails, true, menu_left_thumbnails_default, false);
|
||||
SETTING_UINT("menu_thumbnail_upscale_threshold", &settings->uints.menu_thumbnail_upscale_threshold, true, menu_thumbnail_upscale_threshold, false);
|
||||
@@ -1789,7 +1802,6 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
SETTING_UINT("menu_xmb_animation_horizontal_highlight", &settings->uints.menu_xmb_animation_horizontal_highlight, true, 0 /* TODO/FIXME - implement */, false);
|
||||
SETTING_UINT("menu_xmb_animation_move_up_down", &settings->uints.menu_xmb_animation_move_up_down, true, 0 /* TODO/FIXME - implement */, false);
|
||||
SETTING_UINT("xmb_alpha_factor", &settings->uints.menu_xmb_alpha_factor, true, xmb_alpha_factor, false);
|
||||
SETTING_UINT("xmb_scale_factor", &settings->uints.menu_xmb_scale_factor, true, xmb_scale_factor, false);
|
||||
SETTING_UINT("xmb_layout", &settings->uints.menu_xmb_layout, true, xmb_menu_layout, false);
|
||||
SETTING_UINT("xmb_theme", &settings->uints.menu_xmb_theme, true, xmb_icon_theme, false);
|
||||
SETTING_UINT("xmb_menu_color_theme", &settings->uints.menu_xmb_color_theme, true, xmb_theme, false);
|
||||
@@ -1798,7 +1810,8 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
SETTING_UINT("menu_font_color_blue", &settings->uints.menu_font_color_blue, true, menu_font_color_blue, false);
|
||||
SETTING_UINT("menu_xmb_thumbnail_scale_factor", &settings->uints.menu_xmb_thumbnail_scale_factor, true, xmb_thumbnail_scale_factor, false);
|
||||
#endif
|
||||
SETTING_UINT("materialui_menu_color_theme", &settings->uints.menu_materialui_color_theme, true, MATERIALUI_THEME_BLUE, false);
|
||||
SETTING_UINT("materialui_menu_color_theme", &settings->uints.menu_materialui_color_theme, true, DEFAULT_MATERIALUI_THEME, false);
|
||||
SETTING_UINT("materialui_menu_transition_animation", &settings->uints.menu_materialui_transition_animation, true, DEFAULT_MATERIALUI_TRANSITION_ANIM, false);
|
||||
SETTING_UINT("menu_shader_pipeline", &settings->uints.menu_xmb_shader_pipeline, true, DEFAULT_MENU_SHADER_PIPELINE, false);
|
||||
#ifdef HAVE_OZONE
|
||||
SETTING_UINT("ozone_menu_color_theme", &settings->uints.menu_ozone_color_theme, true, 1, false);
|
||||
@@ -1827,7 +1840,11 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
SETTING_UINT("netplay_share_analog", &settings->uints.netplay_share_analog, true, netplay_share_analog, false);
|
||||
#endif
|
||||
#ifdef HAVE_LANGEXTRA
|
||||
#ifdef VITA
|
||||
SETTING_UINT("user_language", msg_hash_get_uint(MSG_HASH_USER_LANGUAGE), true, frontend_driver_get_user_language(), false);
|
||||
#else
|
||||
SETTING_UINT("user_language", msg_hash_get_uint(MSG_HASH_USER_LANGUAGE), true, DEFAULT_USER_LANGUAGE, false);
|
||||
#endif
|
||||
#endif
|
||||
SETTING_UINT("bundle_assets_extract_version_current", &settings->uints.bundle_assets_extract_version_current, true, 0, false);
|
||||
SETTING_UINT("bundle_assets_extract_last_version", &settings->uints.bundle_assets_extract_last_version, true, 0, false);
|
||||
@@ -1867,6 +1884,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
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_sublabel_last_played_style", &settings->uints.playlist_sublabel_last_played_style, true, DEFAULT_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE, false);
|
||||
#endif
|
||||
|
||||
*size = count;
|
||||
@@ -2110,6 +2128,7 @@ void config_set_defaults(void)
|
||||
settings->bools.ssh_enable = filestream_exists(LAKKA_SSH_PATH);
|
||||
settings->bools.samba_enable = filestream_exists(LAKKA_SAMBA_PATH);
|
||||
settings->bools.bluetooth_enable = filestream_exists(LAKKA_BLUETOOTH_PATH);
|
||||
settings->bools.localap_enable = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
@@ -3102,7 +3121,7 @@ static bool config_load_file(const char *path, settings_t *settings)
|
||||
sizeof(global->name.savefile));
|
||||
fill_pathname_dir(global->name.savefile,
|
||||
path_get(RARCH_PATH_BASENAME),
|
||||
file_path_str(FILE_PATH_SRM_EXTENSION),
|
||||
".srm",
|
||||
sizeof(global->name.savefile));
|
||||
}
|
||||
}
|
||||
@@ -3127,7 +3146,7 @@ static bool config_load_file(const char *path, settings_t *settings)
|
||||
sizeof(global->name.savestate));
|
||||
fill_pathname_dir(global->name.savestate,
|
||||
path_get(RARCH_PATH_BASENAME),
|
||||
file_path_str(FILE_PATH_STATE_EXTENSION),
|
||||
".state",
|
||||
sizeof(global->name.savestate));
|
||||
}
|
||||
}
|
||||
@@ -3252,19 +3271,19 @@ bool config_load_override(void)
|
||||
fill_pathname_join_special_ext(game_path,
|
||||
config_directory, core_name,
|
||||
game_name,
|
||||
file_path_str(FILE_PATH_CONFIG_EXTENSION),
|
||||
".cfg",
|
||||
path_size);
|
||||
|
||||
fill_pathname_join_special_ext(content_path,
|
||||
config_directory, core_name,
|
||||
content_dir_name,
|
||||
file_path_str(FILE_PATH_CONFIG_EXTENSION),
|
||||
".cfg",
|
||||
path_size);
|
||||
|
||||
fill_pathname_join_special_ext(core_path,
|
||||
config_directory, core_name,
|
||||
core_name,
|
||||
file_path_str(FILE_PATH_CONFIG_EXTENSION),
|
||||
".cfg",
|
||||
path_size);
|
||||
|
||||
free(config_directory);
|
||||
@@ -3479,19 +3498,19 @@ bool config_load_remap(const char *directory_input_remapping)
|
||||
fill_pathname_join_special_ext(core_path,
|
||||
remap_directory, core_name,
|
||||
core_name,
|
||||
file_path_str(FILE_PATH_REMAP_EXTENSION),
|
||||
".rmp",
|
||||
path_size);
|
||||
|
||||
fill_pathname_join_special_ext(content_path,
|
||||
remap_directory, core_name,
|
||||
content_dir_name,
|
||||
file_path_str(FILE_PATH_REMAP_EXTENSION),
|
||||
".rmp",
|
||||
path_size);
|
||||
|
||||
fill_pathname_join_special_ext(game_path,
|
||||
remap_directory, core_name,
|
||||
game_name,
|
||||
file_path_str(FILE_PATH_REMAP_EXTENSION),
|
||||
".rmp",
|
||||
path_size);
|
||||
|
||||
input_remapping_set_defaults(false);
|
||||
@@ -3635,7 +3654,7 @@ bool config_save_autoconf_profile(const char *path, unsigned user)
|
||||
fill_pathname_join(buf_new, buf,
|
||||
path, path_size);
|
||||
fill_pathname_noext(autoconf_file, buf_new,
|
||||
file_path_str(FILE_PATH_CONFIG_EXTENSION),
|
||||
".cfg",
|
||||
path_size);
|
||||
|
||||
free(buf_new);
|
||||
@@ -3645,7 +3664,7 @@ bool config_save_autoconf_profile(const char *path, unsigned user)
|
||||
fill_pathname_join(buf, autoconf_dir,
|
||||
path, path_size);
|
||||
fill_pathname_noext(autoconf_file, buf,
|
||||
file_path_str(FILE_PATH_CONFIG_EXTENSION),
|
||||
".cfg",
|
||||
path_size);
|
||||
}
|
||||
|
||||
@@ -3994,19 +4013,19 @@ bool config_save_overrides(int override_type)
|
||||
fill_pathname_join_special_ext(game_path,
|
||||
config_directory, core_name,
|
||||
game_name,
|
||||
file_path_str(FILE_PATH_CONFIG_EXTENSION),
|
||||
".cfg",
|
||||
path_size);
|
||||
|
||||
fill_pathname_join_special_ext(content_path,
|
||||
config_directory, core_name,
|
||||
content_dir_name,
|
||||
file_path_str(FILE_PATH_CONFIG_EXTENSION),
|
||||
".cfg",
|
||||
path_size);
|
||||
|
||||
fill_pathname_join_special_ext(core_path,
|
||||
config_directory, core_name,
|
||||
core_name,
|
||||
file_path_str(FILE_PATH_CONFIG_EXTENSION),
|
||||
".cfg",
|
||||
path_size);
|
||||
|
||||
if (!conf)
|
||||
@@ -4050,88 +4069,46 @@ bool config_save_overrides(int override_type)
|
||||
for (i = 0; i < (unsigned)bool_settings_size; i++)
|
||||
{
|
||||
if ((*bool_settings[i].ptr) != (*bool_overrides[i].ptr))
|
||||
{
|
||||
RARCH_LOG(" original: %s=%d\n",
|
||||
bool_settings[i].ident, (*bool_settings[i].ptr));
|
||||
RARCH_LOG(" override: %s=%d\n",
|
||||
bool_overrides[i].ident, (*bool_overrides[i].ptr));
|
||||
config_set_bool(conf, bool_overrides[i].ident,
|
||||
(*bool_overrides[i].ptr));
|
||||
}
|
||||
}
|
||||
for (i = 0; i < (unsigned)int_settings_size; i++)
|
||||
{
|
||||
if ((*int_settings[i].ptr) != (*int_overrides[i].ptr))
|
||||
{
|
||||
RARCH_LOG(" original: %s=%d\n",
|
||||
int_settings[i].ident, (*int_settings[i].ptr));
|
||||
RARCH_LOG(" override: %s=%d\n",
|
||||
int_overrides[i].ident, (*int_overrides[i].ptr));
|
||||
config_set_int(conf, int_overrides[i].ident,
|
||||
(*int_overrides[i].ptr));
|
||||
}
|
||||
}
|
||||
for (i = 0; i < (unsigned)uint_settings_size; i++)
|
||||
{
|
||||
if ((*uint_settings[i].ptr) != (*uint_overrides[i].ptr))
|
||||
{
|
||||
RARCH_LOG(" original: %s=%d\n",
|
||||
uint_settings[i].ident, (*uint_settings[i].ptr));
|
||||
RARCH_LOG(" override: %s=%d\n",
|
||||
uint_overrides[i].ident, (*uint_overrides[i].ptr));
|
||||
config_set_int(conf, uint_overrides[i].ident,
|
||||
(*uint_overrides[i].ptr));
|
||||
}
|
||||
}
|
||||
for (i = 0; i < (unsigned)size_settings_size; i++)
|
||||
{
|
||||
if ((*size_settings[i].ptr) != (*size_overrides[i].ptr))
|
||||
{
|
||||
RARCH_LOG(" original: %s=%d\n",
|
||||
size_settings[i].ident, (*size_settings[i].ptr));
|
||||
RARCH_LOG(" override: %s=%d\n",
|
||||
size_overrides[i].ident, (*size_overrides[i].ptr));
|
||||
config_set_int(conf, size_overrides[i].ident,
|
||||
(int)(*size_overrides[i].ptr));
|
||||
}
|
||||
}
|
||||
for (i = 0; i < (unsigned)float_settings_size; i++)
|
||||
{
|
||||
if ((*float_settings[i].ptr) != (*float_overrides[i].ptr))
|
||||
{
|
||||
RARCH_LOG(" original: %s=%f\n",
|
||||
float_settings[i].ident, *float_settings[i].ptr);
|
||||
RARCH_LOG(" override: %s=%f\n",
|
||||
float_overrides[i].ident, *float_overrides[i].ptr);
|
||||
config_set_float(conf, float_overrides[i].ident,
|
||||
*float_overrides[i].ptr);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < (unsigned)array_settings_size; i++)
|
||||
{
|
||||
if (!string_is_equal(array_settings[i].ptr, array_overrides[i].ptr))
|
||||
{
|
||||
RARCH_LOG(" original: %s=%s\n",
|
||||
array_settings[i].ident, array_settings[i].ptr);
|
||||
RARCH_LOG(" override: %s=%s\n",
|
||||
array_overrides[i].ident, array_overrides[i].ptr);
|
||||
config_set_string(conf, array_overrides[i].ident,
|
||||
array_overrides[i].ptr);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < (unsigned)path_settings_size; i++)
|
||||
{
|
||||
if (!string_is_equal(path_settings[i].ptr, path_overrides[i].ptr))
|
||||
{
|
||||
RARCH_LOG(" original: %s=%s\n",
|
||||
path_settings[i].ident, path_settings[i].ptr);
|
||||
RARCH_LOG(" override: %s=%s\n",
|
||||
path_overrides[i].ident, path_overrides[i].ptr);
|
||||
config_set_path(conf, path_overrides[i].ident,
|
||||
path_overrides[i].ptr);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_USERS; i++)
|
||||
|
||||
+15
-4
@@ -130,6 +130,7 @@ typedef struct settings
|
||||
bool input_overlay_hide_in_menu;
|
||||
bool input_overlay_show_physical_inputs;
|
||||
bool input_overlay_show_mouse_cursor;
|
||||
bool input_overlay_auto_rotate;
|
||||
bool input_descriptor_label_show;
|
||||
bool input_descriptor_hide_unbound;
|
||||
bool input_all_users_control_menu;
|
||||
@@ -160,7 +161,6 @@ typedef struct settings
|
||||
bool menu_pointer_enable;
|
||||
bool menu_navigation_wraparound_enable;
|
||||
bool menu_navigation_browser_filter_supported_extensions_enable;
|
||||
bool menu_dpi_override_enable;
|
||||
bool menu_show_advanced_settings;
|
||||
bool menu_throttle_framerate;
|
||||
bool menu_linear_filter;
|
||||
@@ -186,6 +186,8 @@ typedef struct settings
|
||||
bool menu_show_video_layout;
|
||||
#endif
|
||||
bool menu_materialui_icons_enable;
|
||||
bool menu_materialui_optimize_landscape_layout;
|
||||
bool menu_materialui_auto_rotate_nav_bar;
|
||||
bool menu_rgui_background_filler_thickness_enable;
|
||||
bool menu_rgui_border_filler_thickness_enable;
|
||||
bool menu_rgui_border_filler_enable;
|
||||
@@ -303,6 +305,9 @@ typedef struct settings
|
||||
bool bundle_finished;
|
||||
bool bundle_assets_extract_enable;
|
||||
|
||||
/* Driver */
|
||||
bool driver_switch_enable;
|
||||
|
||||
/* Misc. */
|
||||
bool discord_enable;
|
||||
bool threaded_data_runloop_enable;
|
||||
@@ -349,6 +354,7 @@ typedef struct settings
|
||||
bool ssh_enable;
|
||||
bool samba_enable;
|
||||
bool bluetooth_enable;
|
||||
bool localap_enable;
|
||||
|
||||
bool automatically_add_content_to_playlist;
|
||||
bool video_window_show_decorations;
|
||||
@@ -368,6 +374,7 @@ typedef struct settings
|
||||
bool enable_device_vibration;
|
||||
bool ozone_collapse_sidebar;
|
||||
bool ozone_truncate_playlist_name;
|
||||
bool ozone_scroll_content_metadata;
|
||||
|
||||
bool log_to_file;
|
||||
bool log_to_file_timestamp;
|
||||
@@ -375,6 +382,7 @@ typedef struct settings
|
||||
bool scan_without_core_match;
|
||||
|
||||
bool ai_service_enable;
|
||||
bool ai_service_pause;
|
||||
} bools;
|
||||
|
||||
struct
|
||||
@@ -392,6 +400,7 @@ typedef struct settings
|
||||
float video_msg_color_b;
|
||||
float video_msg_bgcolor_opacity;
|
||||
|
||||
float menu_scale_factor;
|
||||
float menu_wallpaper_opacity;
|
||||
float menu_framebuffer_opacity;
|
||||
float menu_footer_opacity;
|
||||
@@ -454,7 +463,9 @@ typedef struct settings
|
||||
|
||||
unsigned input_bind_timeout;
|
||||
unsigned input_bind_hold;
|
||||
|
||||
#ifdef GEKKO
|
||||
unsigned input_mouse_scale;
|
||||
#endif
|
||||
unsigned input_menu_toggle_gamepad_combo;
|
||||
unsigned input_keyboard_gamepad_mapping_type;
|
||||
unsigned input_poll_type_behavior;
|
||||
@@ -512,19 +523,18 @@ typedef struct settings
|
||||
unsigned menu_thumbnail_upscale_threshold;
|
||||
unsigned menu_rgui_thumbnail_downscaler;
|
||||
unsigned menu_rgui_thumbnail_delay;
|
||||
unsigned menu_dpi_override_value;
|
||||
unsigned menu_rgui_color_theme;
|
||||
unsigned menu_xmb_animation_opening_main_menu;
|
||||
unsigned menu_xmb_animation_horizontal_highlight;
|
||||
unsigned menu_xmb_animation_move_up_down;
|
||||
unsigned menu_xmb_layout;
|
||||
unsigned menu_xmb_shader_pipeline;
|
||||
unsigned menu_xmb_scale_factor;
|
||||
unsigned menu_xmb_alpha_factor;
|
||||
unsigned menu_xmb_theme;
|
||||
unsigned menu_xmb_color_theme;
|
||||
unsigned menu_xmb_thumbnail_scale_factor;
|
||||
unsigned menu_materialui_color_theme;
|
||||
unsigned menu_materialui_transition_animation;
|
||||
unsigned menu_ozone_color_theme;
|
||||
unsigned menu_font_color_red;
|
||||
unsigned menu_font_color_green;
|
||||
@@ -538,6 +548,7 @@ typedef struct settings
|
||||
unsigned playlist_entry_remove_enable;
|
||||
unsigned playlist_show_inline_core_name;
|
||||
unsigned playlist_sublabel_runtime_type;
|
||||
unsigned playlist_sublabel_last_played_style;
|
||||
|
||||
unsigned camera_width;
|
||||
unsigned camera_height;
|
||||
|
||||
+2
-4
@@ -228,9 +228,7 @@ static config_file_t *core_info_list_iterate(
|
||||
}
|
||||
#endif
|
||||
|
||||
strlcat(info_path_base,
|
||||
file_path_str(FILE_PATH_CORE_INFO_EXTENSION),
|
||||
info_path_base_size);
|
||||
strlcat(info_path_base, ".info", info_path_base_size);
|
||||
|
||||
info_path = (char*)malloc(info_path_base_size);
|
||||
fill_pathname_join(info_path,
|
||||
@@ -1136,7 +1134,7 @@ bool core_info_hw_api_supported(core_info_t *info)
|
||||
if (string_is_empty(cur_api))
|
||||
continue;
|
||||
|
||||
cur_api_len = strlen(cur_api);
|
||||
cur_api_len = (int)strlen(cur_api);
|
||||
|
||||
for (j = 0; j < cur_api_len; j++)
|
||||
{
|
||||
|
||||
@@ -386,7 +386,7 @@ void GONG_CORE_PREFIX(retro_init)(void)
|
||||
else
|
||||
GONG_CORE_PREFIX(log_cb) = NULL;
|
||||
|
||||
video_buf = (unsigned char*)calloc(1, WIDTH * HEIGHT * sizeof(unsigned char));
|
||||
video_buf = (unsigned char*)calloc(1, WIDTH * HEIGHT * sizeof(unsigned));
|
||||
|
||||
game_buffer.width = WIDTH;
|
||||
game_buffer.height = HEIGHT;
|
||||
|
||||
+22
-6
@@ -464,6 +464,19 @@ static void do_memchunkhax1(void)
|
||||
write_kaddr(0x1F000008, saved_vram_value);
|
||||
}
|
||||
|
||||
Result get_luma_version(u32 *major, u32 *minor) {
|
||||
s64 out;
|
||||
u32 version;
|
||||
|
||||
if (R_FAILED(svcGetSystemInfo(&out, 0x10000, 0)))
|
||||
return -1;
|
||||
|
||||
version = (u32)out;
|
||||
*major = GET_VERSION_MAJOR(version);
|
||||
*minor = GET_VERSION_MINOR(version);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Result svchax_init(bool patch_srv)
|
||||
{
|
||||
bool isNew3DS;
|
||||
@@ -475,12 +488,15 @@ Result svchax_init(bool patch_srv)
|
||||
{
|
||||
if (__service_ptr)
|
||||
{
|
||||
if (kver > SYSTEM_VERSION(2, 50, 11))
|
||||
return -1;
|
||||
else if (kver > SYSTEM_VERSION(2, 46, 0))
|
||||
do_memchunkhax2();
|
||||
else
|
||||
do_memchunkhax1();
|
||||
u32 luma_major, luma_minor;
|
||||
|
||||
if (kver > SYSTEM_VERSION(2, 50, 11) &&
|
||||
(R_FAILED(get_luma_version(&luma_major, &luma_minor) || luma_major < 8)))
|
||||
return -1;
|
||||
else if (kver > SYSTEM_VERSION(2, 46, 0) && kver <= SYSTEM_VERSION(2, 50, 11))
|
||||
do_memchunkhax2();
|
||||
else if (kver <= SYSTEM_VERSION(2, 46, 0))
|
||||
do_memchunkhax1();
|
||||
}
|
||||
|
||||
svc_7b((backdoor_fn)k_enable_all_svcs, isNew3DS);
|
||||
|
||||
+8
-10
@@ -38,8 +38,7 @@ int database_info_build_query_enum(char *s, size_t len,
|
||||
bool add_quotes = true;
|
||||
bool add_glob = false;
|
||||
|
||||
string_add_bracket_open(s, len);
|
||||
string_add_single_quote(s, len);
|
||||
strlcpy(s, "{'", len);
|
||||
|
||||
switch (type)
|
||||
{
|
||||
@@ -51,7 +50,7 @@ int database_info_build_query_enum(char *s, size_t len,
|
||||
break;
|
||||
case DATABASE_QUERY_ENTRY_DEVELOPER:
|
||||
strlcat(s, "developer", len);
|
||||
add_glob = true;
|
||||
add_glob = true;
|
||||
add_quotes = false;
|
||||
break;
|
||||
case DATABASE_QUERY_ENTRY_ORIGIN:
|
||||
@@ -110,19 +109,18 @@ int database_info_build_query_enum(char *s, size_t len,
|
||||
break;
|
||||
}
|
||||
|
||||
string_add_single_quote(s, len);
|
||||
string_add_colon(s, len);
|
||||
strlcat(s, "':", len);
|
||||
if (add_glob)
|
||||
string_add_glob_open(s, len);
|
||||
strlcat(s, "glob('*", len);
|
||||
if (add_quotes)
|
||||
string_add_quote(s, len);
|
||||
strlcat(s, "\"", len);
|
||||
strlcat(s, path, len);
|
||||
if (add_glob)
|
||||
string_add_glob_close(s, len);
|
||||
strlcat(s, "*')", len);
|
||||
if (add_quotes)
|
||||
string_add_quote(s, len);
|
||||
strlcat(s, "\"", len);
|
||||
|
||||
string_add_bracket_close(s, len);
|
||||
strlcat(s, "}", len);
|
||||
|
||||
#if 0
|
||||
RARCH_LOG("query: %s\n", s);
|
||||
|
||||
@@ -145,7 +145,7 @@ if [ $SALAMANDER = "yes" ]; then
|
||||
if [ $PLATFORM = "vita" ] ; then
|
||||
mkdir -p ../pkg/${platform}/retroarch.vpk/vpk/sce_sys/livearea/contents
|
||||
vita-make-fself -c -s ../retroarchvita_salamander.velf ../pkg/${platform}/retroarch.vpk/vpk/eboot.bin
|
||||
vita-mksfoex -s TITLE_ID=RETROVITA "RetroArch" ../pkg/${platform}/retroarch.vpk/vpk/sce_sys/param.sfo
|
||||
vita-mksfoex -s TITLE_ID=RETROVITA "RetroArch" -d ATTRIBUTE2=12 ../pkg/${platform}/retroarch.vpk/vpk/sce_sys/param.sfo
|
||||
cp ../pkg/${platform}/assets/ICON0.PNG ../pkg/${platform}/retroarch.vpk/vpk/sce_sys/icon0.png
|
||||
cp -R ../pkg/${platform}/assets/livearea ../pkg/${platform}/retroarch.vpk/vpk/sce_sys/
|
||||
make -C ../ -f Makefile.${platform}.salamander clean || exit 1
|
||||
|
||||
+17
-24
@@ -171,7 +171,8 @@ void fill_pathname_application_special(char *s,
|
||||
char *s1 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
char *s2 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
|
||||
s1[0] = s2[0] = '\0';
|
||||
s1[0] = '\0';
|
||||
s2[0] = '\0';
|
||||
|
||||
fill_pathname_application_special(s1,
|
||||
PATH_MAX_LENGTH * sizeof(char),
|
||||
@@ -204,9 +205,7 @@ void fill_pathname_application_special(char *s,
|
||||
fill_pathname_application_special(s1,
|
||||
PATH_MAX_LENGTH * sizeof(char),
|
||||
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS);
|
||||
fill_pathname_join(s, s1,
|
||||
file_path_str(FILE_PATH_BACKGROUND_IMAGE),
|
||||
len);
|
||||
fill_pathname_join(s, s1, "bg.png", len);
|
||||
free(s1);
|
||||
}
|
||||
}
|
||||
@@ -280,10 +279,9 @@ void fill_pathname_application_special(char *s,
|
||||
#ifdef HAVE_XMB
|
||||
{
|
||||
char *s1 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
char *s2 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
s1[0] = s2[0] = '\0';
|
||||
s1[0] = '\0';
|
||||
|
||||
fill_pathname_join(
|
||||
s1,
|
||||
@@ -291,13 +289,9 @@ void fill_pathname_application_special(char *s,
|
||||
"xmb",
|
||||
PATH_MAX_LENGTH * sizeof(char)
|
||||
);
|
||||
fill_pathname_join(s2,
|
||||
s1, xmb_theme_ident(),
|
||||
PATH_MAX_LENGTH * sizeof(char)
|
||||
);
|
||||
strlcpy(s, s2, len);
|
||||
fill_pathname_join(s,
|
||||
s1, xmb_theme_ident(), len);
|
||||
free(s1);
|
||||
free(s2);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
@@ -365,10 +359,7 @@ void fill_pathname_application_special(char *s,
|
||||
fill_pathname_application_special(s1,
|
||||
PATH_MAX_LENGTH * sizeof(char),
|
||||
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB);
|
||||
fill_pathname_join(s, s1,
|
||||
file_path_str(FILE_PATH_TTF_FONT),
|
||||
len);
|
||||
|
||||
fill_pathname_join(s, s1, "font.ttf", len);
|
||||
free(s1);
|
||||
}
|
||||
}
|
||||
@@ -376,11 +367,12 @@ void fill_pathname_application_special(char *s,
|
||||
break;
|
||||
case APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_DISCORD_AVATARS:
|
||||
{
|
||||
char *s1 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
char *s2 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
settings_t *settings = config_get_ptr();
|
||||
char *s1 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
char *s2 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
s1[0] = s2[0] = '\0';
|
||||
s1[0] = '\0';
|
||||
s2[0] = '\0';
|
||||
|
||||
fill_pathname_join(s1,
|
||||
settings->paths.directory_thumbnails,
|
||||
@@ -401,11 +393,12 @@ void fill_pathname_application_special(char *s,
|
||||
|
||||
case APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_CHEEVOS_BADGES:
|
||||
{
|
||||
char *s1 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
char *s2 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
settings_t *settings = config_get_ptr();
|
||||
char *s1 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
char *s2 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
s1[0] = s2[0] = '\0';
|
||||
s1[0] = '\0';
|
||||
s2[0] = '\0';
|
||||
|
||||
fill_pathname_join(s1,
|
||||
settings->paths.directory_thumbnails,
|
||||
|
||||
@@ -504,9 +504,9 @@ static uint64_t frontend_ctr_get_mem_total(void)
|
||||
return osGetMemRegionSize(MEMREGION_ALL);
|
||||
}
|
||||
|
||||
static uint64_t frontend_ctr_get_mem_used(void)
|
||||
static uint64_t frontend_ctr_get_mem_free(void)
|
||||
{
|
||||
return osGetMemRegionUsed(MEMREGION_ALL);
|
||||
return osGetMemRegionFree(MEMREGION_ALL);
|
||||
}
|
||||
|
||||
static enum frontend_powerstate frontend_ctr_get_powerstate(
|
||||
@@ -609,7 +609,7 @@ frontend_ctx_driver_t frontend_ctx_ctr =
|
||||
frontend_ctr_get_powerstate,
|
||||
frontend_ctr_parse_drive_list,
|
||||
frontend_ctr_get_mem_total,
|
||||
frontend_ctr_get_mem_used,
|
||||
frontend_ctr_get_mem_free,
|
||||
NULL, /* install_signal_handler */
|
||||
NULL, /* get_signal_handler_state */
|
||||
NULL, /* set_signal_handler_state */
|
||||
|
||||
@@ -525,11 +525,11 @@ static uint64_t frontend_gx_get_mem_total(void)
|
||||
return total;
|
||||
}
|
||||
|
||||
static uint64_t frontend_gx_get_mem_used(void)
|
||||
static uint64_t frontend_gx_get_mem_free(void)
|
||||
{
|
||||
uint64_t total = SYSMEM1_SIZE - SYS_GetArena1Size();
|
||||
uint64_t total = SYSMEM1_SIZE - (SYSMEM1_SIZE - SYS_GetArena1Size());
|
||||
#if defined(HW_RVL) && !defined(IS_SALAMANDER)
|
||||
total += gx_mem2_used();
|
||||
total += (gx_mem2_total() - gx_mem2_used());
|
||||
#endif
|
||||
return total;
|
||||
}
|
||||
@@ -555,7 +555,7 @@ frontend_ctx_driver_t frontend_ctx_gx = {
|
||||
NULL, /* get_powerstate */
|
||||
frontend_gx_parse_drive_list,
|
||||
frontend_gx_get_mem_total,
|
||||
frontend_gx_get_mem_used,
|
||||
frontend_gx_get_mem_free,
|
||||
NULL, /* install_signal_handler */
|
||||
NULL, /* get_sighandler_state */
|
||||
NULL, /* set_sighandler_state */
|
||||
|
||||
@@ -156,7 +156,7 @@ static void frontend_ps2_init(void *data)
|
||||
int bootDeviceID;
|
||||
|
||||
SifInitRpc(0);
|
||||
#if !defined(DEBUG)
|
||||
#if !defined(DEBUG) || defined(BUILD_FOR_PCSX2)
|
||||
/* Comment this line if you don't wanna debug the output */
|
||||
while(!SifIopReset(NULL, 0)){};
|
||||
#endif
|
||||
@@ -368,7 +368,7 @@ static int frontend_ps2_parse_drive_list(void *data, bool load_content)
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
|
||||
enum_idx,
|
||||
FILE_TYPE_DIRECTORY, 0, 0);
|
||||
#if defined(DEBUG)
|
||||
#if defined(DEBUG) && !defined(BUILD_FOR_PCSX2)
|
||||
menu_entries_append_enum(list,
|
||||
"host:",
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
|
||||
|
||||
@@ -23,9 +23,11 @@
|
||||
#endif
|
||||
|
||||
#ifdef VITA
|
||||
#include <psp2/system_param.h>
|
||||
#include <psp2/power.h>
|
||||
#include <psp2/sysmodule.h>
|
||||
#include <psp2/appmgr.h>
|
||||
#include <psp2/apputil.h>
|
||||
|
||||
#include "../../bootstrap/vita/sbrk.c"
|
||||
#include "../../bootstrap/vita/threading.c"
|
||||
@@ -92,9 +94,9 @@ static void frontend_psp_get_environment_settings(int *argc, char *argv[],
|
||||
logger_init();
|
||||
#elif defined(HAVE_FILE_LOGGER)
|
||||
#ifndef VITA
|
||||
retro_main_log_file_init("ms0:/temp/retroarch-log.txt");
|
||||
retro_main_log_file_init("ms0:/temp/retroarch-log.txt", false);
|
||||
#else
|
||||
retro_main_log_file_init("ux0:/temp/retroarch-log.txt");
|
||||
retro_main_log_file_init("ux0:/temp/retroarch-log.txt", false);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
@@ -300,6 +302,12 @@ static void frontend_psp_init(void *data)
|
||||
scePowerSetGpuClockFrequency(222);
|
||||
scePowerSetGpuXbarClockFrequency(166);
|
||||
sceSysmoduleLoadModule(SCE_SYSMODULE_NET);
|
||||
|
||||
SceAppUtilInitParam appUtilParam;
|
||||
SceAppUtilBootParam appUtilBootParam;
|
||||
memset(&appUtilParam, 0, sizeof(SceAppUtilInitParam));
|
||||
memset(&appUtilBootParam, 0, sizeof(SceAppUtilBootParam));
|
||||
sceAppUtilInit(&appUtilParam, &appUtilBootParam);
|
||||
#else
|
||||
(void)data;
|
||||
/* initialize debug screen */
|
||||
@@ -506,6 +514,64 @@ static int frontend_psp_parse_drive_list(void *data, bool load_content)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef VITA
|
||||
enum retro_language psp_get_retro_lang_from_langid(int langid)
|
||||
{
|
||||
switch (langid)
|
||||
{
|
||||
case SCE_SYSTEM_PARAM_LANG_JAPANESE:
|
||||
return RETRO_LANGUAGE_JAPANESE;
|
||||
case SCE_SYSTEM_PARAM_LANG_FRENCH:
|
||||
return RETRO_LANGUAGE_FRENCH;
|
||||
case SCE_SYSTEM_PARAM_LANG_SPANISH:
|
||||
return RETRO_LANGUAGE_SPANISH;
|
||||
case SCE_SYSTEM_PARAM_LANG_GERMAN:
|
||||
return RETRO_LANGUAGE_GERMAN;
|
||||
case SCE_SYSTEM_PARAM_LANG_ITALIAN:
|
||||
return RETRO_LANGUAGE_ITALIAN;
|
||||
case SCE_SYSTEM_PARAM_LANG_DUTCH:
|
||||
return RETRO_LANGUAGE_DUTCH;
|
||||
case SCE_SYSTEM_PARAM_LANG_PORTUGUESE_PT:
|
||||
return RETRO_LANGUAGE_PORTUGUESE_PORTUGAL;
|
||||
case SCE_SYSTEM_PARAM_LANG_RUSSIAN:
|
||||
return RETRO_LANGUAGE_RUSSIAN;
|
||||
case SCE_SYSTEM_PARAM_LANG_KOREAN:
|
||||
return RETRO_LANGUAGE_KOREAN;
|
||||
case SCE_SYSTEM_PARAM_LANG_CHINESE_T:
|
||||
return RETRO_LANGUAGE_CHINESE_TRADITIONAL;
|
||||
case SCE_SYSTEM_PARAM_LANG_CHINESE_S:
|
||||
return RETRO_LANGUAGE_CHINESE_SIMPLIFIED;
|
||||
case SCE_SYSTEM_PARAM_LANG_POLISH:
|
||||
return RETRO_LANGUAGE_POLISH;
|
||||
case SCE_SYSTEM_PARAM_LANG_PORTUGUESE_BR:
|
||||
return RETRO_LANGUAGE_PORTUGUESE_BRAZIL;
|
||||
case SCE_SYSTEM_PARAM_LANG_TURKISH:
|
||||
return RETRO_LANGUAGE_TURKISH;
|
||||
case SCE_SYSTEM_PARAM_LANG_ENGLISH_US:
|
||||
case SCE_SYSTEM_PARAM_LANG_ENGLISH_GB:
|
||||
default:
|
||||
return RETRO_LANGUAGE_ENGLISH;
|
||||
}
|
||||
}
|
||||
|
||||
enum retro_language frontend_psp_get_user_language(void)
|
||||
{
|
||||
int langid;
|
||||
sceAppUtilSystemParamGetInt(SCE_SYSTEM_PARAM_ID_LANG, &langid);
|
||||
return psp_get_retro_lang_from_langid(langid);
|
||||
}
|
||||
|
||||
static uint64_t frontend_psp_get_mem_total(void)
|
||||
{
|
||||
return _newlib_heap_end - _newlib_heap_base;
|
||||
}
|
||||
|
||||
static uint64_t frontend_psp_get_mem_used(void)
|
||||
{
|
||||
return _newlib_heap_end - _newlib_heap_cur;
|
||||
}
|
||||
#endif
|
||||
|
||||
frontend_ctx_driver_t frontend_ctx_psp = {
|
||||
frontend_psp_get_environment_settings,
|
||||
frontend_psp_init,
|
||||
@@ -526,8 +592,13 @@ frontend_ctx_driver_t frontend_ctx_psp = {
|
||||
frontend_psp_get_architecture,
|
||||
frontend_psp_get_powerstate,
|
||||
frontend_psp_parse_drive_list,
|
||||
#ifdef VITA
|
||||
frontend_psp_get_mem_total,
|
||||
frontend_psp_get_mem_used,
|
||||
#else
|
||||
NULL, /* get_mem_total */
|
||||
NULL, /* get_mem_free */
|
||||
#endif
|
||||
NULL, /* install_signal_handler */
|
||||
NULL, /* get_sighandler_state */
|
||||
NULL, /* set_sighandler_state */
|
||||
@@ -538,10 +609,11 @@ frontend_ctx_driver_t frontend_ctx_psp = {
|
||||
NULL, /* check_for_path_changes */
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
#ifdef VITA
|
||||
frontend_psp_get_user_language,
|
||||
"vita",
|
||||
#else
|
||||
NULL, /* get_user_language */
|
||||
"psp",
|
||||
#endif
|
||||
};
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "../../switch_performance_profiles.h"
|
||||
#include "../../configuration.h"
|
||||
#include <unistd.h>
|
||||
#include <malloc.h>
|
||||
#else
|
||||
#include <libtransistor/nx.h>
|
||||
#include <libtransistor/ipc_helpers.h>
|
||||
@@ -55,8 +56,6 @@
|
||||
static enum frontend_fork switch_fork_mode = FRONTEND_FORK_NONE;
|
||||
static const char *elf_path_cst = "/switch/retroarch_switch.nro";
|
||||
|
||||
static uint64_t frontend_switch_get_mem_used(void);
|
||||
|
||||
bool platform_switch_has_focus = true;
|
||||
|
||||
#ifdef HAVE_LIBNX
|
||||
@@ -816,21 +815,16 @@ static int frontend_switch_parse_drive_list(void *data, bool load_content)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint64_t frontend_switch_get_mem_total(void)
|
||||
static uint64_t frontend_switch_get_mem_free(void)
|
||||
{
|
||||
uint64_t memoryTotal = 0;
|
||||
svcGetInfo(&memoryTotal, 6, 0xffff8001, 0);
|
||||
memoryTotal += frontend_switch_get_mem_used();
|
||||
|
||||
return memoryTotal;
|
||||
struct mallinfo mem_info = mallinfo();
|
||||
return mem_info.fordblks;
|
||||
}
|
||||
|
||||
static uint64_t frontend_switch_get_mem_used(void)
|
||||
static uint64_t frontend_switch_get_mem_total(void)
|
||||
{
|
||||
uint64_t memoryUsed = 0;
|
||||
svcGetInfo(&memoryUsed, 7, 0xffff8001, 0);
|
||||
|
||||
return memoryUsed;
|
||||
struct mallinfo mem_info = mallinfo();
|
||||
return mem_info.usmblks;
|
||||
}
|
||||
|
||||
static enum frontend_powerstate
|
||||
@@ -962,7 +956,7 @@ frontend_ctx_driver_t frontend_ctx_switch =
|
||||
frontend_switch_get_powerstate,
|
||||
frontend_switch_parse_drive_list,
|
||||
frontend_switch_get_mem_total,
|
||||
frontend_switch_get_mem_used,
|
||||
frontend_switch_get_mem_free,
|
||||
NULL, /* install_signal_handler */
|
||||
NULL, /* get_signal_handler_state */
|
||||
NULL, /* set_signal_handler_state */
|
||||
|
||||
@@ -144,10 +144,14 @@ int system_property_get(const char *command,
|
||||
char buffer[PATH_MAX_LENGTH] = {0};
|
||||
char cmd[PATH_MAX_LENGTH] = {0};
|
||||
char *curpos = NULL;
|
||||
size_t buf_pos = strlcpy(cmd, command, sizeof(cmd));
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "%s %s", command, args);
|
||||
cmd[buf_pos] = ' ';
|
||||
cmd[buf_pos+1] = '\0';
|
||||
|
||||
pipe = popen(cmd, "r");
|
||||
buf_pos = strlcat(cmd, args, sizeof(cmd));
|
||||
|
||||
pipe = popen(cmd, "r");
|
||||
|
||||
if (!pipe)
|
||||
goto error;
|
||||
@@ -1689,13 +1693,17 @@ static void frontend_unix_get_env(int *argc,
|
||||
const char *home = getenv("HOME");
|
||||
|
||||
if (xdg)
|
||||
snprintf(base_path, sizeof(base_path),
|
||||
"%s/retroarch", xdg);
|
||||
{
|
||||
strlcpy(base_path, xdg, sizeof(base_path));
|
||||
strlcat(base_path, "/retroarch", sizeof(base_path));
|
||||
}
|
||||
else if (home)
|
||||
snprintf(base_path, sizeof(base_path),
|
||||
"%s/.config/retroarch", home);
|
||||
{
|
||||
strlcpy(base_path, home, sizeof(base_path));
|
||||
strlcat(base_path, "/.config/retroarch", sizeof(base_path));
|
||||
}
|
||||
else
|
||||
snprintf(base_path, sizeof(base_path), "retroarch");
|
||||
strlcpy(base_path, "retroarch", sizeof(base_path));
|
||||
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE], base_path,
|
||||
"cores", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));
|
||||
@@ -1785,11 +1793,8 @@ static void free_saved_state(struct android_app* android_app)
|
||||
static void android_app_destroy(struct android_app *android_app)
|
||||
{
|
||||
JNIEnv *env = NULL;
|
||||
int result = system("sh -c \"sh /sdcard/reset\"");
|
||||
|
||||
RARCH_LOG("android_app_destroy\n");
|
||||
int result;
|
||||
result = system("sh -c \"sh /sdcard/reset\"");
|
||||
RARCH_LOG("Result: %d\n", result);
|
||||
free_saved_state(android_app);
|
||||
|
||||
slock_lock(android_app->mutex);
|
||||
@@ -2039,28 +2044,14 @@ static void frontend_unix_exitspawn(char *core_path, size_t core_path_size)
|
||||
|
||||
static uint64_t frontend_unix_get_mem_total(void)
|
||||
{
|
||||
char line[256];
|
||||
uint64_t total = 0;
|
||||
FILE * data = fopen("/proc/meminfo", "r");
|
||||
if (!data)
|
||||
return 0;
|
||||
|
||||
while (fgets(line, sizeof(line), data))
|
||||
{
|
||||
if (sscanf(line, "MemTotal: " STRING_REP_USIZE " kB", (size_t*)&total) == 1)
|
||||
{
|
||||
fclose(data);
|
||||
total *= 1024;
|
||||
return total;
|
||||
}
|
||||
}
|
||||
|
||||
fclose(data);
|
||||
return 0;
|
||||
long pages = sysconf(_SC_PHYS_PAGES);
|
||||
long page_size = sysconf(_SC_PAGE_SIZE);
|
||||
return pages * page_size;
|
||||
}
|
||||
|
||||
static uint64_t frontend_unix_get_mem_used(void)
|
||||
static uint64_t frontend_unix_get_mem_free(void)
|
||||
{
|
||||
#ifdef ANDROID
|
||||
char line[256];
|
||||
uint64_t total = 0;
|
||||
uint64_t freemem = 0;
|
||||
@@ -2083,7 +2074,12 @@ static uint64_t frontend_unix_get_mem_used(void)
|
||||
}
|
||||
|
||||
fclose(data);
|
||||
return total - freemem - buffers - cached;
|
||||
return freemem - buffers - cached;
|
||||
#else
|
||||
unsigned long long ps = sysconf(_SC_PAGESIZE);
|
||||
unsigned long long pn = sysconf(_SC_AVPHYS_PAGES);
|
||||
return ps * pn;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*#include <valgrind/valgrind.h>*/
|
||||
@@ -2314,11 +2310,8 @@ static bool frontend_unix_check_for_path_changes(path_change_data_t *change_data
|
||||
i += sizeof(struct inotify_event) + event->len;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
static void frontend_unix_set_sustained_performance_mode(bool on)
|
||||
@@ -2340,7 +2333,8 @@ static const char* frontend_unix_get_cpu_model_name(void)
|
||||
#ifdef ANDROID
|
||||
return NULL;
|
||||
#else
|
||||
cpu_features_get_model_name(unix_cpu_model_name, sizeof(unix_cpu_model_name));
|
||||
cpu_features_get_model_name(unix_cpu_model_name,
|
||||
sizeof(unix_cpu_model_name));
|
||||
return unix_cpu_model_name;
|
||||
#endif
|
||||
}
|
||||
@@ -2358,7 +2352,8 @@ enum retro_language frontend_unix_get_user_language(void)
|
||||
|
||||
if (g_android->getUserLanguageString)
|
||||
{
|
||||
CALL_OBJ_METHOD(env, jstr, g_android->activity->clazz, g_android->getUserLanguageString);
|
||||
CALL_OBJ_METHOD(env, jstr,
|
||||
g_android->activity->clazz, g_android->getUserLanguageString);
|
||||
|
||||
if (jstr)
|
||||
{
|
||||
@@ -2410,7 +2405,7 @@ frontend_ctx_driver_t frontend_ctx_unix = {
|
||||
frontend_unix_get_powerstate,
|
||||
frontend_unix_parse_drive_list,
|
||||
frontend_unix_get_mem_total,
|
||||
frontend_unix_get_mem_used,
|
||||
frontend_unix_get_mem_free,
|
||||
frontend_unix_install_signal_handlers,
|
||||
frontend_unix_get_signal_handler_state,
|
||||
frontend_unix_set_signal_handler_state,
|
||||
|
||||
@@ -554,8 +554,7 @@ static void frontend_win32_environment_get(int *argc, char *argv[],
|
||||
":\\logs", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
#ifdef HAVE_MENU
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGL1) || defined(HAVE_OPENGLES) || defined(HAVE_OPENGL_CORE)
|
||||
snprintf(g_defaults.settings.menu,
|
||||
sizeof(g_defaults.settings.menu), "xmb");
|
||||
strlcpy(g_defaults.settings.menu, "xmb", sizeof(g_defaults.settings.menu));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
@@ -624,6 +623,8 @@ static void frontend_win32_attach_console(void)
|
||||
if(!AttachConsole( ATTACH_PARENT_PROCESS))
|
||||
AllocConsole();
|
||||
|
||||
SetConsoleTitle("Log Console");
|
||||
|
||||
if(need_stdout) freopen( "CONOUT$", "w", stdout );
|
||||
if(need_stderr) freopen( "CONOUT$", "w", stderr );
|
||||
|
||||
|
||||
@@ -370,12 +370,12 @@ uint64_t frontend_driver_get_total_memory(void)
|
||||
return frontend->get_total_mem();
|
||||
}
|
||||
|
||||
uint64_t frontend_driver_get_used_memory(void)
|
||||
uint64_t frontend_driver_get_free_memory(void)
|
||||
{
|
||||
frontend_ctx_driver_t *frontend = frontend_get_ptr();
|
||||
if (!frontend || !frontend->get_used_mem)
|
||||
if (!frontend || !frontend->get_free_mem)
|
||||
return 0;
|
||||
return frontend->get_used_mem();
|
||||
return frontend->get_free_mem();
|
||||
}
|
||||
|
||||
void frontend_driver_install_signal_handler(void)
|
||||
|
||||
@@ -95,7 +95,7 @@ typedef struct frontend_ctx_driver
|
||||
enum frontend_powerstate (*get_powerstate)(int *seconds, int *percent);
|
||||
int (*parse_drive_list)(void*, bool);
|
||||
uint64_t (*get_total_mem)(void);
|
||||
uint64_t (*get_used_mem)(void);
|
||||
uint64_t (*get_free_mem)(void);
|
||||
void (*install_signal_handler)(void);
|
||||
int (*get_signal_handler_state)(void);
|
||||
void (*set_signal_handler_state)(int value);
|
||||
@@ -193,7 +193,7 @@ bool frontend_driver_get_salamander_basename(char *s, size_t len);
|
||||
|
||||
uint64_t frontend_driver_get_total_memory(void);
|
||||
|
||||
uint64_t frontend_driver_get_used_memory(void);
|
||||
uint64_t frontend_driver_get_free_memory(void);
|
||||
|
||||
void frontend_driver_install_signal_handler(void);
|
||||
|
||||
|
||||
@@ -307,21 +307,6 @@ void dxgi_update_title(video_frame_info_t* video_info)
|
||||
{
|
||||
#ifndef __WINRT__
|
||||
const ui_window_t* window = ui_companion_driver_get_window_ptr();
|
||||
const settings_t *settings = config_get_ptr();
|
||||
|
||||
if (settings->bools.video_memory_show)
|
||||
{
|
||||
char mem[128];
|
||||
uint64_t mem_bytes_used = frontend_driver_get_used_memory();
|
||||
uint64_t mem_bytes_total = frontend_driver_get_total_memory();
|
||||
|
||||
mem[0] = '\0';
|
||||
|
||||
snprintf(
|
||||
mem, sizeof(mem), " || MEM: %.2f/%.2fMB", mem_bytes_used / (1024.0f * 1024.0f),
|
||||
mem_bytes_total / (1024.0f * 1024.0f));
|
||||
strlcat(video_info->fps_text, mem, sizeof(video_info->fps_text));
|
||||
}
|
||||
|
||||
if (window)
|
||||
{
|
||||
|
||||
@@ -23,6 +23,11 @@ typedef struct
|
||||
__unsafe_unretained id<MTLBuffer> buffer;
|
||||
} BufferRange;
|
||||
|
||||
typedef NS_ENUM(NSUInteger, ViewportResetMode) {
|
||||
kFullscreenViewport,
|
||||
kVideoViewport
|
||||
};
|
||||
|
||||
/*! @brief Context contains the render state used by various components */
|
||||
@interface Context : NSObject
|
||||
|
||||
@@ -59,8 +64,8 @@ typedef struct
|
||||
- (void)convertFormat:(RPixelFormat)fmt from:(id<MTLTexture>)src to:(id<MTLTexture>)dst;
|
||||
- (id<MTLRenderPipelineState>)getStockShader:(int)index blend:(bool)blend;
|
||||
|
||||
/*! @brief resets the viewport for the main render encoder to the drawable size */
|
||||
- (void)resetRenderViewport;
|
||||
/*! @brief resets the viewport for the main render encoder to \a mode */
|
||||
- (void)resetRenderViewport:(ViewportResetMode)mode;
|
||||
|
||||
/*! @brief resets the scissor rect for the main render encoder to the drawable size */
|
||||
- (void)resetScissorRect;
|
||||
|
||||
@@ -493,8 +493,10 @@
|
||||
|
||||
- (id<MTLCommandBuffer>)blitCommandBuffer
|
||||
{
|
||||
if (!_blitCommandBuffer)
|
||||
if (!_blitCommandBuffer) {
|
||||
_blitCommandBuffer = [_commandQueue commandBuffer];
|
||||
_blitCommandBuffer.label = @"Blit command buffer";
|
||||
}
|
||||
return _blitCommandBuffer;
|
||||
}
|
||||
|
||||
@@ -562,6 +564,7 @@
|
||||
assert(_commandBuffer == nil);
|
||||
dispatch_semaphore_wait(_inflightSemaphore, DISPATCH_TIME_FOREVER);
|
||||
_commandBuffer = [_commandQueue commandBuffer];
|
||||
_commandBuffer.label = @"Frame command buffer";
|
||||
_backBuffer = nil;
|
||||
}
|
||||
|
||||
@@ -579,17 +582,19 @@
|
||||
_backBuffer = self.nextDrawable.texture;
|
||||
}
|
||||
_rce = [_commandBuffer renderCommandEncoderWithDescriptor:rpd];
|
||||
_rce.label = @"Frame command encoder";
|
||||
}
|
||||
return _rce;
|
||||
}
|
||||
|
||||
- (void)resetRenderViewport
|
||||
- (void)resetRenderViewport:(ViewportResetMode)mode
|
||||
{
|
||||
bool fullscreen = mode == kFullscreenViewport;
|
||||
MTLViewport vp = {
|
||||
.originX = 0,
|
||||
.originY = 0,
|
||||
.width = _viewport.full_width,
|
||||
.height = _viewport.full_height,
|
||||
.originX = fullscreen ? 0 : _viewport.x,
|
||||
.originY = fullscreen ? 0 : _viewport.y,
|
||||
.width = fullscreen ? _viewport.full_width : _viewport.width,
|
||||
.height = fullscreen ? _viewport.full_height : _viewport.height,
|
||||
.znear = 0,
|
||||
.zfar = 1,
|
||||
};
|
||||
|
||||
@@ -52,7 +52,6 @@
|
||||
{
|
||||
id<MTLComputeCommandEncoder> ce = [cb computeCommandEncoder];
|
||||
ce.label = @"filter kernel";
|
||||
[ce pushDebugGroup:@"filter kernel"];
|
||||
|
||||
[ce setComputePipelineState:_kernel];
|
||||
|
||||
@@ -67,7 +66,6 @@
|
||||
|
||||
[ce dispatchThreadgroups:count threadsPerThreadgroup:size];
|
||||
|
||||
[ce popDebugGroup];
|
||||
[ce endEncoding];
|
||||
}
|
||||
|
||||
@@ -75,8 +73,7 @@
|
||||
{
|
||||
id<MTLComputeCommandEncoder> ce = [cb computeCommandEncoder];
|
||||
ce.label = @"filter kernel";
|
||||
[ce pushDebugGroup:@"filter kernel"];
|
||||
|
||||
|
||||
[ce setComputePipelineState:_kernel];
|
||||
|
||||
[ce setBuffer:tin offset:0 atIndex:0];
|
||||
@@ -89,7 +86,6 @@
|
||||
|
||||
[ce dispatchThreadgroups:count threadsPerThreadgroup:size];
|
||||
|
||||
[ce popDebugGroup];
|
||||
[ce endEncoding];
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
id<MTLRenderCommandEncoder> rce = _context.rce;
|
||||
if (_clearNextRender)
|
||||
{
|
||||
[_context resetRenderViewport];
|
||||
[_context resetRenderViewport:kFullscreenViewport];
|
||||
[_context drawQuadX:0
|
||||
y:0
|
||||
w:1
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
//
|
||||
// metal_common.h
|
||||
// RetroArch_Metal
|
||||
//
|
||||
// Created by Stuart Carnie on 5/14/18.
|
||||
//
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2018-2019 - Stuart Carnie
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef METAL_COMMON_H__
|
||||
#define METAL_COMMON_H__
|
||||
@@ -26,6 +35,38 @@ extern MTLPixelFormat SelectOptimalPixelFormat(MTLPixelFormat fmt);
|
||||
|
||||
#pragma mark - Classes
|
||||
|
||||
#import <MetalKit/MetalKit.h>
|
||||
|
||||
@interface MetalView : MTKView
|
||||
@end
|
||||
|
||||
#ifdef HAVE_COCOA_METAL
|
||||
|
||||
@protocol ApplePlatform
|
||||
|
||||
/*! @brief renderView returns the current render view based on the viewType */
|
||||
@property (readonly) id renderView;
|
||||
|
||||
/*! @brief isActive returns true if the application has focus */
|
||||
@property (readonly) bool hasFocus;
|
||||
|
||||
@property (readwrite) apple_view_type_t viewType;
|
||||
|
||||
/*! @brief setVideoMode adjusts the video display to the specified mode */
|
||||
- (void)setVideoMode:(gfx_ctx_mode_t)mode;
|
||||
|
||||
/*! @brief setCursorVisible specifies whether the cursor is visible */
|
||||
- (void)setCursorVisible:(bool)v;
|
||||
|
||||
/*! @brief controls whether the screen saver should be disabled and
|
||||
* the displays should not sleep.
|
||||
*/
|
||||
- (bool)setDisableDisplaySleep:(bool)disable;
|
||||
@end
|
||||
|
||||
extern id<ApplePlatform> apple_platform;
|
||||
#endif
|
||||
|
||||
@interface FrameView : NSObject
|
||||
|
||||
@property (nonatomic, readonly) RPixelFormat format;
|
||||
|
||||
+83
-36
@@ -1,8 +1,17 @@
|
||||
/*
|
||||
* metal_common.m
|
||||
* RetroArch_Metal
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2018-2019 - Stuart Carnie
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
*
|
||||
* Created by Stuart Carnie on 5/14/18.
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
@@ -39,6 +48,24 @@
|
||||
x = (__bridge __typeof__(x))(__bridge_retained void *)((NSObject *)__y); \
|
||||
}
|
||||
|
||||
@implementation MetalView
|
||||
|
||||
- (void)keyDown:(NSEvent*)theEvent
|
||||
{
|
||||
}
|
||||
|
||||
/* Stop the annoying sound when pressing a key. */
|
||||
- (BOOL)acceptsFirstResponder
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)isFlipped
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
@end
|
||||
|
||||
#pragma mark - private categories
|
||||
|
||||
@interface FrameView()
|
||||
@@ -83,7 +110,6 @@
|
||||
id<MTLSamplerState> _samplerStateNearest;
|
||||
|
||||
// other state
|
||||
Uniforms _uniforms;
|
||||
Uniforms _viewportMVP;
|
||||
}
|
||||
|
||||
@@ -270,23 +296,16 @@
|
||||
[_frameView updateFrame:data pitch:pitch];
|
||||
}
|
||||
|
||||
[self _drawViews:video_info];
|
||||
[self _drawCore:video_info];
|
||||
[self _drawMenu:video_info];
|
||||
|
||||
if (video_info->statistics_show)
|
||||
{
|
||||
struct font_params *osd_params = (struct font_params *)&video_info->osd_stat_params;
|
||||
|
||||
if (osd_params)
|
||||
{
|
||||
font_driver_render_msg(video_info, NULL, video_info->stat_text, osd_params);
|
||||
}
|
||||
}
|
||||
id<MTLRenderCommandEncoder> rce = _context.rce;
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
if (_overlay.enabled)
|
||||
{
|
||||
id<MTLRenderCommandEncoder> rce = _context.rce;
|
||||
[rce pushDebugGroup:@"overlay"];
|
||||
[_context resetRenderViewport:_overlay.fullscreen ? kFullscreenViewport : kVideoViewport];
|
||||
[rce setRenderPipelineState:[_context getStockShader:VIDEO_SHADER_STOCK_BLEND blend:YES]];
|
||||
[rce setVertexBytes:_context.uniforms length:sizeof(*_context.uniforms) atIndex:BufferIndexUniforms];
|
||||
[rce setFragmentSamplerState:_samplerStateLinear atIndex:SamplerIndexDraw];
|
||||
@@ -295,15 +314,35 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
if (video_info->statistics_show)
|
||||
{
|
||||
struct font_params *osd_params = (struct font_params *)&video_info->osd_stat_params;
|
||||
|
||||
if (osd_params)
|
||||
{
|
||||
[rce pushDebugGroup:@"video stats"];
|
||||
font_driver_render_msg(video_info, NULL, video_info->stat_text, osd_params);
|
||||
[rce popDebugGroup];
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
if (video_info->widgets_inited)
|
||||
{
|
||||
[rce pushDebugGroup:@"menu widgets"];
|
||||
menu_widgets_frame(video_info);
|
||||
[rce popDebugGroup];
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (msg && *msg)
|
||||
{
|
||||
[rce pushDebugGroup:@"message"];
|
||||
[self _renderMessage:msg info:video_info];
|
||||
[rce popDebugGroup];
|
||||
}
|
||||
|
||||
[self _endFrame];
|
||||
}
|
||||
@@ -340,7 +379,7 @@
|
||||
float g = settings->uints.video_msg_bgcolor_green / 255.0f;
|
||||
float b = settings->uints.video_msg_bgcolor_blue / 255.0f;
|
||||
float a = settings->floats.video_msg_bgcolor_opacity;
|
||||
[_context resetRenderViewport];
|
||||
[_context resetRenderViewport:kFullscreenViewport];
|
||||
[_context drawQuadX:x y:y w:width h:height r:r g:g b:b a:a];
|
||||
}
|
||||
|
||||
@@ -358,7 +397,7 @@
|
||||
[_context begin];
|
||||
}
|
||||
|
||||
- (void)_drawViews:(video_frame_info_t *)video_info
|
||||
- (void)_drawCore:(video_frame_info_t *)video_info
|
||||
{
|
||||
id<MTLRenderCommandEncoder> rce = _context.rce;
|
||||
|
||||
@@ -381,11 +420,20 @@
|
||||
[_frameView drawWithEncoder:rce];
|
||||
}
|
||||
[rce popDebugGroup];
|
||||
}
|
||||
|
||||
if (_menu.enabled && _menu.hasFrame)
|
||||
- (void)_drawMenu:(video_frame_info_t *)video_info
|
||||
{
|
||||
if (!_menu.enabled)
|
||||
return;
|
||||
|
||||
id<MTLRenderCommandEncoder> rce = _context.rce;
|
||||
|
||||
if (_menu.hasFrame)
|
||||
{
|
||||
[rce pushDebugGroup:@"menu frame"];
|
||||
[_menu.view drawWithContext:_context];
|
||||
[rce setVertexBytes:&_uniforms length:sizeof(_uniforms) atIndex:BufferIndexUniforms];
|
||||
[rce setVertexBytes:_context.uniforms length:sizeof(*_context.uniforms) atIndex:BufferIndexUniforms];
|
||||
[rce setRenderPipelineState:_t_pipelineState];
|
||||
if (_menu.view.filter == RTextureFilterNearest)
|
||||
{
|
||||
@@ -396,21 +444,13 @@
|
||||
[rce setFragmentSamplerState:_samplerStateLinear atIndex:SamplerIndexDraw];
|
||||
}
|
||||
[_menu.view drawWithEncoder:rce];
|
||||
[rce popDebugGroup];
|
||||
}
|
||||
|
||||
#if defined(HAVE_MENU)
|
||||
if (_menu.enabled)
|
||||
else
|
||||
{
|
||||
MTLViewport viewport = {
|
||||
.originX = 0.0f,
|
||||
.originY = 0.0f,
|
||||
.width = _viewport->full_width,
|
||||
.height = _viewport->full_height,
|
||||
.znear = 0.0f,
|
||||
.zfar = 1.0,
|
||||
};
|
||||
[rce setViewport:viewport];
|
||||
[rce pushDebugGroup:@"menu"];
|
||||
[_context resetRenderViewport:kFullscreenViewport];
|
||||
menu_driver_frame(video_info);
|
||||
[rce popDebugGroup];
|
||||
}
|
||||
@@ -899,6 +939,7 @@ typedef struct MTLALIGN(16)
|
||||
}
|
||||
|
||||
id<MTLCommandBuffer> cb = ctx.blitCommandBuffer;
|
||||
[cb pushDebugGroup:@"shaders"];
|
||||
|
||||
MTLRenderPassDescriptor *rpd = [MTLRenderPassDescriptor new];
|
||||
rpd.colorAttachments[0].loadAction = MTLLoadActionDontCare;
|
||||
@@ -920,12 +961,11 @@ typedef struct MTLALIGN(16)
|
||||
rce = [cb renderCommandEncoderWithDescriptor:rpd];
|
||||
}
|
||||
|
||||
#if DEBUG && METAL_DEBUG
|
||||
rce.label = [NSString stringWithFormat:@"pass %d", i];
|
||||
#endif
|
||||
|
||||
[rce setRenderPipelineState:_engine.pass[i]._state];
|
||||
|
||||
NSURL *shaderPath = [NSURL fileURLWithPath:_engine.pass[i]._state.label];
|
||||
rce.label = shaderPath.lastPathComponent.stringByDeletingPathExtension;
|
||||
|
||||
_engine.pass[i].frame_count = (uint32_t)_frameCount;
|
||||
if (_shader->pass[i].frame_count_mod)
|
||||
_engine.pass[i].frame_count %= _shader->pass[i].frame_count_mod;
|
||||
@@ -997,6 +1037,8 @@ typedef struct MTLALIGN(16)
|
||||
_drawState = ViewDrawStateContext;
|
||||
else
|
||||
_drawState = ViewDrawStateAll;
|
||||
|
||||
[cb popDebugGroup];
|
||||
}
|
||||
|
||||
- (void)_updateRenderTargets
|
||||
@@ -1141,6 +1183,9 @@ typedef struct MTLALIGN(16)
|
||||
config_file_t *conf = video_shader_read_preset(path.UTF8String);
|
||||
struct video_shader *shader = (struct video_shader *)calloc(1, sizeof(*shader));
|
||||
|
||||
settings_t *settings = config_get_ptr();
|
||||
NSString *shadersPath = [NSString stringWithFormat:@"%s/", settings->paths.directory_video_shader];
|
||||
|
||||
@try
|
||||
{
|
||||
unsigned i;
|
||||
@@ -1216,7 +1261,9 @@ typedef struct MTLALIGN(16)
|
||||
vd.layouts[4].stepFunction = MTLVertexStepFunctionPerVertex;
|
||||
|
||||
MTLRenderPipelineDescriptor *psd = [MTLRenderPipelineDescriptor new];
|
||||
psd.label = [NSString stringWithFormat:@"pass %d", i];
|
||||
|
||||
psd.label = [[NSString stringWithUTF8String:shader->pass[i].source.path]
|
||||
stringByReplacingOccurrencesOfString:shadersPath withString:@""];
|
||||
|
||||
MTLRenderPipelineColorAttachmentDescriptor *ca = psd.colorAttachments[0];
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* copyright (c) 2011-2017 - Daniel De Matteis
|
||||
* copyright (c) 2016-2019 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __NETWORK_VIDEO_COMMON_H
|
||||
#define __NETWORK_VIDEO_COMMON_H
|
||||
|
||||
typedef struct network
|
||||
{
|
||||
unsigned video_width;
|
||||
unsigned video_height;
|
||||
unsigned screen_width;
|
||||
unsigned screen_height;
|
||||
void *ctx_data;
|
||||
const gfx_ctx_driver_t *ctx_driver;
|
||||
char address[256];
|
||||
uint16_t port;
|
||||
int fd;
|
||||
} network_video_t;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,81 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2019 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
#endif
|
||||
|
||||
#include <retro_miscellaneous.h>
|
||||
|
||||
#include "sdl2_common.h"
|
||||
#include "../../retroarch.h"
|
||||
|
||||
#ifdef HAVE_SDL2
|
||||
#include "SDL.h"
|
||||
#include "SDL_syswm.h"
|
||||
|
||||
void sdl2_set_handles(void *data, enum rarch_display_type display_type)
|
||||
{
|
||||
/* SysWMinfo headers are broken on OSX. */
|
||||
SDL_SysWMinfo info;
|
||||
SDL_Window *window = (SDL_Window*)data;
|
||||
SDL_VERSION(&info.version);
|
||||
|
||||
if (SDL_GetWindowWMInfo(window, &info) != 1)
|
||||
return;
|
||||
|
||||
video_driver_display_userdata_set((uintptr_t)window);
|
||||
|
||||
switch (display_type)
|
||||
{
|
||||
case RARCH_DISPLAY_WIN32:
|
||||
#if defined(_WIN32)
|
||||
video_driver_display_type_set(RARCH_DISPLAY_WIN32);
|
||||
video_driver_display_set(0);
|
||||
video_driver_window_set((uintptr_t)info.info.win.window);
|
||||
#endif
|
||||
break;
|
||||
case RARCH_DISPLAY_X11:
|
||||
#if defined(HAVE_X11)
|
||||
video_driver_display_type_set(RARCH_DISPLAY_X11);
|
||||
video_driver_display_set((uintptr_t)info.info.x11.display);
|
||||
video_driver_window_set((uintptr_t)info.info.x11.window);
|
||||
#endif
|
||||
break;
|
||||
case RARCH_DISPLAY_OSX:
|
||||
#ifdef HAVE_COCOA
|
||||
video_driver_display_type_set(RARCH_DISPLAY_OSX);
|
||||
video_driver_display_set(0);
|
||||
video_driver_window_set((uintptr_t)info.info.cocoa.window);
|
||||
#endif
|
||||
break;
|
||||
case RARCH_DISPLAY_WAYLAND:
|
||||
/* SDL_VIDEO_DRIVER_WAYLAND is defined by SDL2 */
|
||||
#if defined(HAVE_WAYLAND) && defined(SDL_VIDEO_DRIVER_WAYLAND)
|
||||
video_driver_display_type_set(RARCH_DISPLAY_WAYLAND);
|
||||
video_driver_display_set((uintptr_t)info.info.wl.display);
|
||||
video_driver_window_set((uintptr_t)info.info.wl.surface);
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
case RARCH_DISPLAY_NONE:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2011-2019 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
@@ -13,25 +13,15 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <compat/strl.h>
|
||||
#include <retro_assert.h>
|
||||
#include <streams/file_stream.h>
|
||||
#include <file/file_path.h>
|
||||
#include <string/stdstring.h>
|
||||
#ifndef SDL2_COMMON_H__
|
||||
#define SDL2_COMMON_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <boolean.h>
|
||||
|
||||
#include "../video_defines.h"
|
||||
|
||||
void sdl2_set_handles(void *data, enum rarch_display_type
|
||||
display_type);
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../config.h"
|
||||
#endif
|
||||
|
||||
#include "menu_content.h"
|
||||
#include "menu_driver.h"
|
||||
#include "menu_shader.h"
|
||||
|
||||
#include "../core_info.h"
|
||||
#include "../configuration.h"
|
||||
#include "../defaults.h"
|
||||
#include "../playlist.h"
|
||||
#include "../verbosity.h"
|
||||
|
||||
/* This file should probably be removed, but may need
|
||||
* to add something to it in the future... */
|
||||
@@ -1651,12 +1651,6 @@ static bool vulkan_context_init_gpu(gfx_ctx_vulkan_data_t *vk)
|
||||
|
||||
video_driver_set_gpu_api_devices(GFX_CTX_VULKAN_API, vulkan_gpu_list);
|
||||
|
||||
if (vk->context.gpu != VK_NULL_HANDLE)
|
||||
{
|
||||
free(gpus);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (0 <= settings->ints.vulkan_gpu_index && settings->ints.vulkan_gpu_index < (int)gpu_count)
|
||||
{
|
||||
RARCH_LOG("[Vulkan]: Using GPU index %d.\n", settings->ints.vulkan_gpu_index);
|
||||
@@ -1908,11 +1902,8 @@ static bool vulkan_context_init_device(gfx_ctx_vulkan_data_t *vk)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (vk->context.queue == VK_NULL_HANDLE)
|
||||
{
|
||||
vkGetDeviceQueue(vk->context.device,
|
||||
vk->context.graphics_queue_index, 0, &vk->context.queue);
|
||||
}
|
||||
vkGetDeviceQueue(vk->context.device,
|
||||
vk->context.graphics_queue_index, 0, &vk->context.queue);
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
vk->context.queue_lock = slock_new();
|
||||
@@ -2677,13 +2668,17 @@ void vulkan_context_destroy(gfx_ctx_vulkan_data_t *vk,
|
||||
else
|
||||
{
|
||||
if (vk->context.device)
|
||||
{
|
||||
vkDestroyDevice(vk->context.device, NULL);
|
||||
vk->context.device = NULL;
|
||||
}
|
||||
if (vk->context.instance)
|
||||
{
|
||||
if (vk->context.destroy_device)
|
||||
vk->context.destroy_device();
|
||||
|
||||
vkDestroyInstance(vk->context.instance, NULL);
|
||||
vk->context.instance = NULL;
|
||||
|
||||
if (vulkan_library)
|
||||
{
|
||||
|
||||
@@ -992,6 +992,7 @@ bool win32_window_create(void *data, unsigned style,
|
||||
|
||||
video_driver_display_type_set(RARCH_DISPLAY_WIN32);
|
||||
video_driver_display_set(0);
|
||||
video_driver_display_userdata_set((uintptr_t)&main_window);
|
||||
video_driver_window_set((uintptr_t)main_window.hwnd);
|
||||
|
||||
#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0500 /* 2K */
|
||||
|
||||
+5
-16
@@ -554,6 +554,8 @@ bool x11_alive(void *data)
|
||||
case 4: /* Grabbed */
|
||||
/* Scroll up */
|
||||
case 5: /* Scroll down */
|
||||
case 6: /* Scroll wheel left */
|
||||
case 7: /* Scroll wheel right */
|
||||
x_input_poll_wheel(&event.xbutton, true);
|
||||
break;
|
||||
}
|
||||
@@ -679,30 +681,17 @@ bool x11_connect(void)
|
||||
|
||||
void x11_update_title(void *data, void *data2)
|
||||
{
|
||||
const settings_t *settings = config_get_ptr();
|
||||
video_frame_info_t *video_info = (video_frame_info_t*)data2;
|
||||
char title[128];
|
||||
|
||||
title[0] = '\0';
|
||||
|
||||
if (settings->bools.video_memory_show)
|
||||
{
|
||||
uint64_t mem_bytes_used = frontend_driver_get_used_memory();
|
||||
uint64_t mem_bytes_total = frontend_driver_get_total_memory();
|
||||
char mem[128];
|
||||
|
||||
mem[0] = '\0';
|
||||
|
||||
snprintf(
|
||||
mem, sizeof(mem), " || MEM: %.2f/%.2fMB", mem_bytes_used / (1024.0f * 1024.0f),
|
||||
mem_bytes_total / (1024.0f * 1024.0f));
|
||||
strlcat(video_info->fps_text, mem, sizeof(video_info->fps_text));
|
||||
}
|
||||
|
||||
video_driver_get_window_title(title, sizeof(title));
|
||||
|
||||
if (title[0])
|
||||
XStoreName(g_x11_dpy, g_x11_win, title);
|
||||
XChangeProperty(g_x11_dpy, g_x11_win, XA_WM_NAME, XA_STRING,
|
||||
8, PropModeReplace, (const unsigned char*)title,
|
||||
strlen(title));
|
||||
}
|
||||
|
||||
bool x11_input_ctx_new(bool true_full)
|
||||
|
||||
@@ -747,9 +747,9 @@ static bool ctr_frame(void* data, const void* frame,
|
||||
ctr->frame_coords->u1 = width;
|
||||
ctr->frame_coords->v1 = height;
|
||||
GSPGPU_FlushDataCache(ctr->frame_coords, sizeof(ctr_vertex_t));
|
||||
ctrGuSetVertexShaderFloatUniform(0, (float*)&ctr->scale_vector, 1);
|
||||
}
|
||||
|
||||
ctrGuSetVertexShaderFloatUniform(0, (float*)&ctr->scale_vector, 1);
|
||||
ctrGuSetTexture(GPU_TEXUNIT0, VIRT_TO_PHYS(ctr->texture_swizzled), ctr->texture_width, ctr->texture_height,
|
||||
(ctr->smooth? GPU_TEXTURE_MAG_FILTER(GPU_LINEAR) | GPU_TEXTURE_MIN_FILTER(GPU_LINEAR)
|
||||
: GPU_TEXTURE_MAG_FILTER(GPU_NEAREST) | GPU_TEXTURE_MIN_FILTER(GPU_NEAREST)) |
|
||||
|
||||
@@ -1460,28 +1460,9 @@ static void d3d8_get_overlay_interface(void *data,
|
||||
|
||||
static void d3d8_update_title(video_frame_info_t *video_info)
|
||||
{
|
||||
const settings_t *settings = config_get_ptr();
|
||||
#ifndef _XBOX
|
||||
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
||||
#endif
|
||||
|
||||
if (settings->bools.video_memory_show)
|
||||
{
|
||||
#ifndef __WINRT__
|
||||
uint64_t mem_bytes_used = frontend_driver_get_used_memory();
|
||||
uint64_t mem_bytes_total = frontend_driver_get_total_memory();
|
||||
char mem[128];
|
||||
|
||||
mem[0] = '\0';
|
||||
|
||||
snprintf(
|
||||
mem, sizeof(mem), " || MEM: %.2f/%.2fMB", mem_bytes_used / (1024.0f * 1024.0f),
|
||||
mem_bytes_total / (1024.0f * 1024.0f));
|
||||
strlcat(video_info->fps_text, mem, sizeof(video_info->fps_text));
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef _XBOX
|
||||
if (window)
|
||||
{
|
||||
char title[128];
|
||||
|
||||
+2
-23
@@ -1510,30 +1510,9 @@ static void d3d9_get_overlay_interface(void *data,
|
||||
|
||||
static void d3d9_update_title(video_frame_info_t *video_info)
|
||||
{
|
||||
const settings_t *settings = config_get_ptr();
|
||||
#ifdef _XBOX
|
||||
const ui_window_t *window = NULL;
|
||||
#else
|
||||
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
||||
#endif
|
||||
|
||||
if (settings->bools.video_memory_show)
|
||||
{
|
||||
#ifndef __WINRT__
|
||||
uint64_t mem_bytes_used = frontend_driver_get_used_memory();
|
||||
uint64_t mem_bytes_total = frontend_driver_get_total_memory();
|
||||
char mem[128];
|
||||
|
||||
mem[0] = '\0';
|
||||
|
||||
snprintf(
|
||||
mem, sizeof(mem), " || MEM: %.2f/%.2fMB", mem_bytes_used / (1024.0f * 1024.0f),
|
||||
mem_bytes_total / (1024.0f * 1024.0f));
|
||||
strlcat(video_info->fps_text, mem, sizeof(video_info->fps_text));
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef _XBOX
|
||||
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
||||
|
||||
if (window)
|
||||
{
|
||||
char title[128];
|
||||
|
||||
@@ -0,0 +1,584 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2016-2017 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#include "../../menu/menu_driver.h"
|
||||
#endif
|
||||
|
||||
#include "../font_driver.h"
|
||||
|
||||
#include "../../driver.h"
|
||||
#include "../../configuration.h"
|
||||
#include "../../verbosity.h"
|
||||
#include "../common/fpga_common.h"
|
||||
|
||||
typedef struct RegOp
|
||||
{
|
||||
int fd;
|
||||
void *ptr;
|
||||
int only_mmap;
|
||||
int only_munmap;
|
||||
} RegOp;
|
||||
|
||||
static unsigned char *fpga_menu_frame = NULL;
|
||||
static unsigned fpga_menu_width = 0;
|
||||
static unsigned fpga_menu_height = 0;
|
||||
static unsigned fpga_menu_pitch = 0;
|
||||
static unsigned fpga_video_width = 0;
|
||||
static unsigned fpga_video_height = 0;
|
||||
static unsigned fpga_video_pitch = 0;
|
||||
static unsigned fpga_video_bits = 0;
|
||||
static unsigned fpga_menu_bits = 0;
|
||||
static bool fpga_rgb32 = false;
|
||||
static bool fpga_menu_rgb32 = false;
|
||||
static RegOp regOp;
|
||||
|
||||
static unsigned int get_memory_size(void)
|
||||
{
|
||||
FILE *size_fp;
|
||||
unsigned int size;
|
||||
|
||||
/* this file holds the memory range needed to map the framebuffer into
|
||||
* kernel address space, it is specified in the device tree
|
||||
*/
|
||||
size_fp = fopen("/sys/class/uio/uio0/maps/map0/size", "r");
|
||||
|
||||
if (!size_fp)
|
||||
{
|
||||
RARCH_ERR("unable to open the uio size file\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
fscanf(size_fp, "0x%08X", &size);
|
||||
fclose(size_fp);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
static void do_mmap_op(RegOp *regOp)
|
||||
{
|
||||
if (regOp->only_munmap == 0)
|
||||
{
|
||||
regOp->fd = open("/dev/uio0", O_RDWR);
|
||||
|
||||
if (regOp->fd < 1)
|
||||
return;
|
||||
|
||||
regOp->ptr = mmap(NULL, get_memory_size(), PROT_READ|PROT_WRITE, MAP_SHARED, regOp->fd, 0);
|
||||
|
||||
if (regOp->ptr == MAP_FAILED)
|
||||
{
|
||||
RARCH_ERR("could not mmap() memory\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (regOp->only_mmap == 0)
|
||||
{
|
||||
if (munmap(regOp->ptr, get_memory_size()) == -1)
|
||||
{
|
||||
RARCH_ERR("could not munmap() memory\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
close(regOp->fd);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void fpga_gfx_create(fpga_t *fpga)
|
||||
{
|
||||
memset(®Op, 0, sizeof(regOp));
|
||||
|
||||
regOp.only_mmap = 1;
|
||||
|
||||
do_mmap_op(®Op);
|
||||
|
||||
fpga->framebuffer = ((volatile unsigned*)regOp.ptr);
|
||||
}
|
||||
|
||||
static void *fpga_gfx_init(const video_info_t *video,
|
||||
const input_driver_t **input, void **input_data)
|
||||
{
|
||||
unsigned full_x, full_y;
|
||||
gfx_ctx_input_t inp;
|
||||
gfx_ctx_mode_t mode;
|
||||
const gfx_ctx_driver_t *ctx_driver = NULL;
|
||||
unsigned win_width = 0, win_height = 0;
|
||||
unsigned temp_width = 0, temp_height = 0;
|
||||
settings_t *settings = config_get_ptr();
|
||||
fpga_t *fpga = (fpga_t*)calloc(1, sizeof(*fpga));
|
||||
|
||||
*input = NULL;
|
||||
*input_data = NULL;
|
||||
|
||||
fpga_video_width = video->width;
|
||||
fpga_video_height = video->height;
|
||||
fpga_rgb32 = video->rgb32;
|
||||
|
||||
fpga_video_bits = video->rgb32 ? 32 : 16;
|
||||
|
||||
if (video->rgb32)
|
||||
fpga_video_pitch = video->width * 4;
|
||||
else
|
||||
fpga_video_pitch = video->width * 2;
|
||||
|
||||
fpga_gfx_create(fpga);
|
||||
|
||||
ctx_driver = video_context_driver_init_first(fpga,
|
||||
settings->arrays.video_context_driver,
|
||||
GFX_CTX_FPGA_API, 1, 0, false);
|
||||
if (!ctx_driver)
|
||||
goto error;
|
||||
|
||||
video_context_driver_set((const gfx_ctx_driver_t*)ctx_driver);
|
||||
|
||||
RARCH_LOG("[FPGA]: Found FPGA context: %s\n", ctx_driver->ident);
|
||||
|
||||
video_context_driver_get_video_size(&mode);
|
||||
|
||||
full_x = mode.width;
|
||||
full_y = mode.height;
|
||||
mode.width = 0;
|
||||
mode.height = 0;
|
||||
|
||||
RARCH_LOG("[FPGA]: Detecting screen resolution %ux%u.\n", full_x, full_y);
|
||||
|
||||
win_width = video->width;
|
||||
win_height = video->height;
|
||||
|
||||
if (video->fullscreen && (win_width == 0) && (win_height == 0))
|
||||
{
|
||||
win_width = full_x;
|
||||
win_height = full_y;
|
||||
}
|
||||
|
||||
mode.width = win_width;
|
||||
mode.height = win_height;
|
||||
mode.fullscreen = video->fullscreen;
|
||||
|
||||
if (!video_context_driver_set_video_mode(&mode))
|
||||
goto error;
|
||||
|
||||
mode.width = 0;
|
||||
mode.height = 0;
|
||||
|
||||
video_context_driver_get_video_size(&mode);
|
||||
|
||||
temp_width = mode.width;
|
||||
temp_height = mode.height;
|
||||
mode.width = 0;
|
||||
mode.height = 0;
|
||||
|
||||
/* Get real known video size, which might have been altered by context. */
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
video_driver_set_size(&temp_width, &temp_height);
|
||||
|
||||
video_driver_get_size(&temp_width, &temp_height);
|
||||
|
||||
RARCH_LOG("[FPGA]: Using resolution %ux%u\n", temp_width, temp_height);
|
||||
|
||||
inp.input = input;
|
||||
inp.input_data = input_data;
|
||||
|
||||
video_context_driver_input_driver(&inp);
|
||||
|
||||
if (settings->bools.video_font_enable)
|
||||
font_driver_init_osd(NULL, false,
|
||||
video->is_threaded,
|
||||
FONT_DRIVER_RENDER_FPGA);
|
||||
|
||||
RARCH_LOG("[FPGA]: Init complete.\n");
|
||||
|
||||
return fpga;
|
||||
|
||||
error:
|
||||
video_context_driver_destroy();
|
||||
if (fpga)
|
||||
free(fpga);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool fpga_gfx_frame(void *data, const void *frame,
|
||||
unsigned frame_width, unsigned frame_height, uint64_t frame_count,
|
||||
unsigned pitch, const char *msg, video_frame_info_t *video_info)
|
||||
{
|
||||
gfx_ctx_mode_t mode;
|
||||
const void *frame_to_copy = frame;
|
||||
unsigned width = 0;
|
||||
unsigned height = 0;
|
||||
unsigned bits = fpga_video_bits;
|
||||
bool draw = true;
|
||||
fpga_t *fpga = (fpga_t*)data;
|
||||
|
||||
if (!frame || !frame_width || !frame_height)
|
||||
return true;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
menu_driver_frame(video_info);
|
||||
#endif
|
||||
|
||||
if (fpga_video_width != frame_width || fpga_video_height != frame_height || fpga_video_pitch != pitch)
|
||||
{
|
||||
if (frame_width > 4 && frame_height > 4)
|
||||
{
|
||||
fpga_video_width = frame_width;
|
||||
fpga_video_height = frame_height;
|
||||
fpga_video_pitch = pitch;
|
||||
}
|
||||
}
|
||||
|
||||
if (fpga_menu_frame && video_info->menu_is_alive)
|
||||
{
|
||||
frame_to_copy = fpga_menu_frame;
|
||||
width = fpga_menu_width;
|
||||
height = fpga_menu_height;
|
||||
pitch = fpga_menu_pitch;
|
||||
bits = fpga_menu_bits;
|
||||
}
|
||||
else
|
||||
{
|
||||
width = fpga_video_width;
|
||||
height = fpga_video_height;
|
||||
pitch = fpga_video_pitch;
|
||||
|
||||
if (frame_width == 4 && frame_height == 4 && (frame_width < width && frame_height < height))
|
||||
draw = false;
|
||||
|
||||
if (video_info->menu_is_alive)
|
||||
draw = false;
|
||||
}
|
||||
|
||||
video_context_driver_get_video_size(&mode);
|
||||
|
||||
if (draw)
|
||||
{
|
||||
if (bits == 16)
|
||||
{
|
||||
if (frame_to_copy == fpga_menu_frame)
|
||||
{
|
||||
/* RGBX4444 color bits for RGUI */
|
||||
unsigned x, y;
|
||||
|
||||
for (y = 0; y < FB_HEIGHT; y++)
|
||||
{
|
||||
for (x = 0; x < FB_WIDTH; x++)
|
||||
{
|
||||
/* scale incoming frame to fit the screen */
|
||||
unsigned scaled_x = (width * x) / FB_WIDTH;
|
||||
unsigned scaled_y = (height * y) / FB_HEIGHT;
|
||||
unsigned short pixel = ((unsigned short*)frame_to_copy)[width * scaled_y + scaled_x];
|
||||
|
||||
/* convert RGBX444 to XRGB8888 */
|
||||
unsigned r = ((pixel & 0xF000) >> 12);
|
||||
unsigned g = ((pixel & 0x0F00) >> 8);
|
||||
unsigned b = ((pixel & 0x00F0) >> 4);
|
||||
|
||||
fpga->framebuffer[FB_WIDTH * y + x] = (r << 20) | (b << 12) | (g << 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* RGB565 color bits for core */
|
||||
unsigned x, y;
|
||||
|
||||
for (y = 0; y < FB_HEIGHT; y++)
|
||||
{
|
||||
for (x = 0; x < FB_WIDTH; x++)
|
||||
{
|
||||
/* scale incoming frame to fit the screen */
|
||||
unsigned scaled_x = (width * x) / FB_WIDTH;
|
||||
unsigned scaled_y = (height * y) / FB_HEIGHT;
|
||||
unsigned short pixel = ((unsigned short*)frame_to_copy)[width * scaled_y + scaled_x];
|
||||
|
||||
/* convert RGB565 to XRBG8888 */
|
||||
unsigned r = ((pixel & 0xF800) >> 11);
|
||||
unsigned g = ((pixel & 0x07E0) >> 5);
|
||||
unsigned b = ((pixel & 0x001F) >> 0);
|
||||
|
||||
fpga->framebuffer[FB_WIDTH * y + x] = (r << 19) | (b << 11) | (g << 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* TODO/FIXME: handle 32-bit core output */
|
||||
}
|
||||
}
|
||||
|
||||
if (msg)
|
||||
font_driver_render_msg(video_info, NULL, msg, NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void fpga_gfx_set_nonblock_state(void *data, bool toggle)
|
||||
{
|
||||
(void)data;
|
||||
(void)toggle;
|
||||
}
|
||||
|
||||
static bool fpga_gfx_alive(void *data)
|
||||
{
|
||||
gfx_ctx_size_t size_data;
|
||||
unsigned temp_width = 0;
|
||||
unsigned temp_height = 0;
|
||||
bool quit = false;
|
||||
bool resize = false;
|
||||
|
||||
/* Needed because some context drivers don't track their sizes */
|
||||
video_driver_get_size(&temp_width, &temp_height);
|
||||
|
||||
size_data.quit = &quit;
|
||||
size_data.resize = &resize;
|
||||
size_data.width = &temp_width;
|
||||
size_data.height = &temp_height;
|
||||
|
||||
video_context_driver_check_window(&size_data);
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
video_driver_set_size(&temp_width, &temp_height);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool fpga_gfx_focus(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool fpga_gfx_suppress_screensaver(void *data, bool enable)
|
||||
{
|
||||
(void)data;
|
||||
(void)enable;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool fpga_gfx_has_windowed(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void fpga_gfx_free(void *data)
|
||||
{
|
||||
fpga_t *fpga = (fpga_t*)data;
|
||||
|
||||
if (fpga_menu_frame)
|
||||
{
|
||||
free(fpga_menu_frame);
|
||||
fpga_menu_frame = NULL;
|
||||
}
|
||||
|
||||
if (!fpga)
|
||||
return;
|
||||
|
||||
font_driver_free_osd();
|
||||
video_context_driver_free();
|
||||
|
||||
free(fpga);
|
||||
|
||||
regOp.only_mmap = 0;
|
||||
regOp.only_munmap = 1;
|
||||
|
||||
do_mmap_op(®Op);
|
||||
}
|
||||
|
||||
static bool fpga_gfx_set_shader(void *data,
|
||||
enum rarch_shader_type type, const char *path)
|
||||
{
|
||||
(void)data;
|
||||
(void)type;
|
||||
(void)path;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void fpga_gfx_set_rotation(void *data,
|
||||
unsigned rotation)
|
||||
{
|
||||
(void)data;
|
||||
(void)rotation;
|
||||
}
|
||||
|
||||
static void fpga_gfx_viewport_info(void *data,
|
||||
struct video_viewport *vp)
|
||||
{
|
||||
(void)data;
|
||||
(void)vp;
|
||||
}
|
||||
|
||||
static bool fpga_gfx_read_viewport(void *data, uint8_t *buffer, bool is_idle)
|
||||
{
|
||||
(void)data;
|
||||
(void)buffer;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void fpga_set_texture_frame(void *data,
|
||||
const void *frame, bool rgb32, unsigned width, unsigned height,
|
||||
float alpha)
|
||||
{
|
||||
unsigned pitch = width * 2;
|
||||
|
||||
if (rgb32)
|
||||
pitch = width * 4;
|
||||
|
||||
if (fpga_menu_frame)
|
||||
{
|
||||
free(fpga_menu_frame);
|
||||
fpga_menu_frame = NULL;
|
||||
}
|
||||
|
||||
if (!fpga_menu_frame || fpga_menu_width != width || fpga_menu_height != height || fpga_menu_pitch != pitch)
|
||||
if (pitch && height)
|
||||
fpga_menu_frame = (unsigned char*)malloc(pitch * height);
|
||||
|
||||
if (fpga_menu_frame && frame && pitch && height)
|
||||
{
|
||||
memcpy(fpga_menu_frame, frame, pitch * height);
|
||||
fpga_menu_width = width;
|
||||
fpga_menu_height = height;
|
||||
fpga_menu_pitch = pitch;
|
||||
fpga_menu_bits = rgb32 ? 32 : 16;
|
||||
}
|
||||
}
|
||||
|
||||
static void fpga_set_osd_msg(void *data,
|
||||
video_frame_info_t *video_info,
|
||||
const char *msg,
|
||||
const void *params, void *font)
|
||||
{
|
||||
font_driver_render_msg(video_info, font, msg, params);
|
||||
}
|
||||
|
||||
static void fpga_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 fpga_get_video_output_prev(void *data)
|
||||
{
|
||||
video_context_driver_get_video_output_prev();
|
||||
}
|
||||
|
||||
static void fpga_get_video_output_next(void *data)
|
||||
{
|
||||
video_context_driver_get_video_output_next();
|
||||
}
|
||||
|
||||
static void fpga_set_video_mode(void *data, unsigned width, unsigned height,
|
||||
bool fullscreen)
|
||||
{
|
||||
gfx_ctx_mode_t mode;
|
||||
|
||||
mode.width = width;
|
||||
mode.height = height;
|
||||
mode.fullscreen = fullscreen;
|
||||
|
||||
video_context_driver_set_video_mode(&mode);
|
||||
}
|
||||
|
||||
static const video_poke_interface_t fpga_poke_interface = {
|
||||
NULL,
|
||||
NULL,
|
||||
fpga_set_video_mode,
|
||||
NULL,
|
||||
fpga_get_video_output_size,
|
||||
fpga_get_video_output_prev,
|
||||
fpga_get_video_output_next,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
#if defined(HAVE_MENU)
|
||||
fpga_set_texture_frame,
|
||||
NULL,
|
||||
fpga_set_osd_msg,
|
||||
NULL,
|
||||
#else
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
#endif
|
||||
|
||||
NULL,
|
||||
#ifdef HAVE_MENU
|
||||
NULL,
|
||||
#endif
|
||||
};
|
||||
|
||||
static void fpga_gfx_get_poke_interface(void *data,
|
||||
const video_poke_interface_t **iface)
|
||||
{
|
||||
(void)data;
|
||||
*iface = &fpga_poke_interface;
|
||||
}
|
||||
|
||||
static void fpga_gfx_set_viewport(void *data, unsigned viewport_width,
|
||||
unsigned viewport_height, bool force_full, bool allow_rotate)
|
||||
{
|
||||
}
|
||||
|
||||
bool fpga_has_menu_frame(void)
|
||||
{
|
||||
return (fpga_menu_frame != NULL);
|
||||
}
|
||||
|
||||
video_driver_t video_fpga = {
|
||||
fpga_gfx_init,
|
||||
fpga_gfx_frame,
|
||||
fpga_gfx_set_nonblock_state,
|
||||
fpga_gfx_alive,
|
||||
fpga_gfx_focus,
|
||||
fpga_gfx_suppress_screensaver,
|
||||
fpga_gfx_has_windowed,
|
||||
fpga_gfx_set_shader,
|
||||
fpga_gfx_free,
|
||||
"fpga",
|
||||
fpga_gfx_set_viewport,
|
||||
fpga_gfx_set_rotation,
|
||||
fpga_gfx_viewport_info,
|
||||
fpga_gfx_read_viewport,
|
||||
NULL, /* read_frame_raw */
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
NULL, /* overlay_interface */
|
||||
#endif
|
||||
fpga_gfx_get_poke_interface,
|
||||
};
|
||||
+3
-2
@@ -3064,8 +3064,9 @@ static bool gl2_frame(void *data, const void *frame,
|
||||
font_driver_render_msg(video_info, NULL, msg, NULL);
|
||||
}
|
||||
|
||||
video_info->cb_update_window_title(
|
||||
video_info->context_data, video_info);
|
||||
if (video_info->cb_update_window_title)
|
||||
video_info->cb_update_window_title(
|
||||
video_info->context_data, video_info);
|
||||
|
||||
/* Reset state which could easily mess up libretro core. */
|
||||
if (gl->hw_render_fbo_init)
|
||||
|
||||
+40
-13
@@ -387,7 +387,7 @@ static void *gl1_gfx_init(const video_info_t *video,
|
||||
video->is_threaded,
|
||||
FONT_DRIVER_RENDER_OPENGL1_API);
|
||||
|
||||
gl1->smooth = settings->bools.video_smooth;
|
||||
gl1->smooth = settings->bools.video_smooth;
|
||||
gl1->supports_bgra = string_list_find_elem(gl1->extensions, "GL_EXT_bgra");
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
@@ -546,10 +546,12 @@ void gl1_gfx_set_viewport(gl1_t *gl1,
|
||||
|
||||
static void draw_tex(gl1_t *gl1, int pot_width, int pot_height, int width, int height, GLuint tex, const void *frame_to_copy)
|
||||
{
|
||||
uint8_t *frame = NULL;
|
||||
uint8_t *frame_rgba = NULL;
|
||||
/* FIXME: For now, everything is uploaded as BGRA8888, I could not get 444 or 555 to work, and there is no 565 support in GL 1.1 either. */
|
||||
GLint internalFormat = GL_RGB8;
|
||||
GLenum format = (gl1->supports_bgra ? GL_BGRA_EXT : GL_RGBA);
|
||||
GLenum type = GL_UNSIGNED_BYTE;
|
||||
GLenum format = gl1->supports_bgra ? GL_BGRA_EXT : GL_RGBA;
|
||||
GLenum type = GL_UNSIGNED_BYTE;
|
||||
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDisable(GL_CULL_FACE);
|
||||
@@ -557,16 +559,41 @@ static void draw_tex(gl1_t *gl1, int pot_width, int pot_height, int width, int h
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
/* multi-texture not part of GL 1.1 */
|
||||
/* Multi-texture not part of GL 1.1 */
|
||||
/*glActiveTexture(GL_TEXTURE0);*/
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, pot_width);
|
||||
glBindTexture(GL_TEXTURE_2D, tex);
|
||||
|
||||
/* TODO: We could implement red/blue swap if client GL does not support BGRA... but even MS GDI Generic supports it */
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, pot_width, pot_height, 0, format, type, NULL);
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, format, type, frame_to_copy);
|
||||
/* For whatever reason you can't send NULL in GLDirect,
|
||||
so we send the frame as dummy data */
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, pot_width, pot_height, 0, format, type, frame_to_copy);
|
||||
|
||||
frame = (uint8_t*)frame_to_copy;
|
||||
if (!gl1->supports_bgra)
|
||||
{
|
||||
frame_rgba = (uint8_t*)malloc(pot_width * pot_height * 4);
|
||||
if (frame_rgba)
|
||||
{
|
||||
int x, y;
|
||||
for (y = 0; y < pot_height; y++)
|
||||
{
|
||||
for (x = 0; x < pot_width; x++)
|
||||
{
|
||||
int index = (y * pot_width + x) * 4;
|
||||
frame_rgba[index + 2] = frame[index + 0];
|
||||
frame_rgba[index + 1] = frame[index + 1];
|
||||
frame_rgba[index + 0] = frame[index + 2];
|
||||
frame_rgba[index + 3] = frame[index + 3];
|
||||
}
|
||||
}
|
||||
frame = frame_rgba;
|
||||
}
|
||||
}
|
||||
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, format, type, frame);
|
||||
free(frame_rgba);
|
||||
|
||||
if (tex == gl1->tex)
|
||||
{
|
||||
@@ -613,16 +640,16 @@ static void draw_tex(gl1_t *gl1, int pot_width, int pot_height, int width, int h
|
||||
glBegin(GL_QUADS);
|
||||
|
||||
{
|
||||
float tex_BL[2] = {0.0f, 0.0f};
|
||||
float tex_BR[2] = {1.0f, 0.0f};
|
||||
float tex_TL[2] = {0.0f, 1.0f};
|
||||
float tex_TR[2] = {1.0f, 1.0f};
|
||||
float tex_BL[2] = {0.0f, 0.0f};
|
||||
float tex_BR[2] = {1.0f, 0.0f};
|
||||
float tex_TL[2] = {0.0f, 1.0f};
|
||||
float tex_TR[2] = {1.0f, 1.0f};
|
||||
float *tex_mirror_BL = tex_TL;
|
||||
float *tex_mirror_BR = tex_TR;
|
||||
float *tex_mirror_TL = tex_BL;
|
||||
float *tex_mirror_TR = tex_BR;
|
||||
float norm_width = (1.0f / (float)pot_width) * (float)width;
|
||||
float norm_height = (1.0f / (float)pot_height) * (float)height;
|
||||
float norm_width = (1.0f / (float)pot_width) * (float)width;
|
||||
float norm_height = (1.0f / (float)pot_height) * (float)height;
|
||||
|
||||
/* remove extra POT padding */
|
||||
tex_mirror_BR[0] = norm_width;
|
||||
|
||||
@@ -1593,6 +1593,8 @@ static void gl_core_draw_menu_texture(gl_core_t *gl, video_frame_info_t *video_i
|
||||
|
||||
if (gl->menu_texture_full_screen)
|
||||
glViewport(0, 0, video_info->width, video_info->height);
|
||||
else
|
||||
glViewport(gl->vp.x, gl->vp.y, gl->vp.width, gl->vp.height);
|
||||
|
||||
glActiveTexture(GL_TEXTURE0 + 1);
|
||||
glBindTexture(GL_TEXTURE_2D, gl->menu_texture);
|
||||
|
||||
@@ -0,0 +1,557 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2016-2019 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <retro_miscellaneous.h>
|
||||
#include <retro_timers.h>
|
||||
#include <stdlib.h>
|
||||
#include <compat/strl.h>
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
#include <net/net_compat.h>
|
||||
#include <net/net_socket.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#include "../../menu/menu_driver.h"
|
||||
#endif
|
||||
|
||||
#include "../font_driver.h"
|
||||
|
||||
#include "../../driver.h"
|
||||
#include "../../configuration.h"
|
||||
#include "../../retroarch.h"
|
||||
#include "../../verbosity.h"
|
||||
#include "../../frontend/frontend_driver.h"
|
||||
#include "../common/network_common.h"
|
||||
|
||||
#define xstr(s) str(s)
|
||||
#define str(s) #s
|
||||
|
||||
enum {
|
||||
NETWORK_VIDEO_PIXELFORMAT_RGBA8888 = 0,
|
||||
NETWORK_VIDEO_PIXELFORMAT_BGRA8888,
|
||||
NETWORK_VIDEO_PIXELFORMAT_RGB565
|
||||
} network_video_pixelformat;
|
||||
|
||||
static unsigned char *network_menu_frame = NULL;
|
||||
static unsigned network_menu_width = 0;
|
||||
static unsigned network_menu_height = 0;
|
||||
static unsigned network_menu_pitch = 0;
|
||||
static unsigned network_video_width = 0;
|
||||
static unsigned network_video_height = 0;
|
||||
static unsigned network_video_pitch = 0;
|
||||
static unsigned network_video_bits = 0;
|
||||
static unsigned network_menu_bits = 0;
|
||||
static bool network_rgb32 = false;
|
||||
static bool network_menu_rgb32 = false;
|
||||
static unsigned *network_video_temp_buf = NULL;
|
||||
|
||||
static void *network_gfx_init(const video_info_t *video,
|
||||
input_driver_t **input, void **input_data)
|
||||
{
|
||||
gfx_ctx_input_t inp;
|
||||
void *ctx_data = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
network_video_t *network = (network_video_t*)calloc(1, sizeof(*network));
|
||||
const gfx_ctx_driver_t *ctx_driver = NULL;
|
||||
struct addrinfo *addr = NULL, *next_addr = NULL;
|
||||
int fd;
|
||||
|
||||
*input = NULL;
|
||||
*input_data = NULL;
|
||||
|
||||
network_rgb32 = video->rgb32;
|
||||
network_video_bits = video->rgb32 ? 32 : 16;
|
||||
|
||||
if (video->rgb32)
|
||||
network_video_pitch = video->width * 4;
|
||||
else
|
||||
network_video_pitch = video->width * 2;
|
||||
|
||||
ctx_driver = video_context_driver_init_first(network,
|
||||
"network",
|
||||
GFX_CTX_NETWORK_VIDEO_API, 1, 0, false, &ctx_data);
|
||||
|
||||
if (!ctx_driver)
|
||||
goto error;
|
||||
|
||||
if (ctx_data)
|
||||
network->ctx_data = ctx_data;
|
||||
|
||||
network->ctx_driver = ctx_driver;
|
||||
video_context_driver_set((const gfx_ctx_driver_t*)ctx_driver);
|
||||
|
||||
RARCH_LOG("[network]: Found network video context: %s\n", ctx_driver->ident);
|
||||
|
||||
inp.input = input;
|
||||
inp.input_data = input_data;
|
||||
|
||||
video_context_driver_input_driver(&inp);
|
||||
|
||||
if (settings->bools.video_font_enable)
|
||||
font_driver_init_osd(network, false,
|
||||
video->is_threaded,
|
||||
FONT_DRIVER_RENDER_NETWORK_VIDEO);
|
||||
|
||||
strlcpy(network->address, xstr(NETWORK_VIDEO_HOST), sizeof(network->address));
|
||||
network->port = NETWORK_VIDEO_PORT;
|
||||
|
||||
RARCH_LOG("[network] Connecting to host %s:%d\n", network->address, network->port);
|
||||
try_connect:
|
||||
fd = socket_init((void**)&addr, network->port, network->address, SOCKET_TYPE_STREAM);
|
||||
|
||||
next_addr = addr;
|
||||
|
||||
while (fd >= 0)
|
||||
{
|
||||
{
|
||||
int ret = socket_connect(fd, (void*)next_addr, true);
|
||||
|
||||
if (ret >= 0) /* && socket_nonblock(fd)) */
|
||||
break;
|
||||
|
||||
socket_close(fd);
|
||||
}
|
||||
|
||||
fd = socket_next((void**)&next_addr);
|
||||
}
|
||||
|
||||
if (addr)
|
||||
freeaddrinfo_retro(addr);
|
||||
|
||||
network->fd = fd;
|
||||
|
||||
#if 0
|
||||
socket_nonblock(network->fd);
|
||||
#endif
|
||||
|
||||
if (network->fd > 0)
|
||||
RARCH_LOG("[network]: Connected to host.\n");
|
||||
else
|
||||
{
|
||||
RARCH_LOG("[network]: Could not connect to host, retrying...\n");
|
||||
retro_sleep(1000);
|
||||
goto try_connect;
|
||||
}
|
||||
|
||||
RARCH_LOG("[network]: Init complete.\n");
|
||||
|
||||
return network;
|
||||
|
||||
error:
|
||||
video_context_driver_destroy();
|
||||
if (network)
|
||||
free(network);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool network_gfx_frame(void *data, const void *frame,
|
||||
unsigned frame_width, unsigned frame_height, uint64_t frame_count,
|
||||
unsigned pitch, const char *msg, video_frame_info_t *video_info)
|
||||
{
|
||||
gfx_ctx_mode_t mode;
|
||||
const void *frame_to_copy = frame;
|
||||
unsigned width = 0;
|
||||
unsigned height = 0;
|
||||
unsigned bits = network_video_bits;
|
||||
unsigned pixfmt = NETWORK_VIDEO_PIXELFORMAT_RGB565;
|
||||
bool draw = true;
|
||||
network_video_t *network = (network_video_t*)data;
|
||||
|
||||
if (!frame || !frame_width || !frame_height)
|
||||
return true;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
menu_driver_frame(video_info);
|
||||
#endif
|
||||
|
||||
if (network_video_width != frame_width || network_video_height != frame_height || network_video_pitch != pitch)
|
||||
{
|
||||
if (frame_width > 4 && frame_height > 4)
|
||||
{
|
||||
network_video_width = frame_width;
|
||||
network_video_height = frame_height;
|
||||
network_video_pitch = pitch;
|
||||
network->screen_width = network_video_width;
|
||||
network->screen_height = network_video_height;
|
||||
}
|
||||
}
|
||||
|
||||
if (network_menu_frame && video_info->menu_is_alive)
|
||||
{
|
||||
frame_to_copy = network_menu_frame;
|
||||
width = network_menu_width;
|
||||
height = network_menu_height;
|
||||
pitch = network_menu_pitch;
|
||||
bits = network_menu_bits;
|
||||
}
|
||||
else
|
||||
{
|
||||
width = network_video_width;
|
||||
height = network_video_height;
|
||||
pitch = network_video_pitch;
|
||||
|
||||
if (frame_width == 4 && frame_height == 4 && (frame_width < width && frame_height < height))
|
||||
draw = false;
|
||||
|
||||
if (video_info->menu_is_alive)
|
||||
draw = false;
|
||||
}
|
||||
|
||||
if (network->video_width != width || network->video_height != height)
|
||||
{
|
||||
network->video_width = width;
|
||||
network->video_height = height;
|
||||
|
||||
if (network_video_temp_buf)
|
||||
{
|
||||
free(network_video_temp_buf);
|
||||
}
|
||||
|
||||
network_video_temp_buf = (unsigned*)malloc(network->screen_width * network->screen_height * sizeof(unsigned));
|
||||
}
|
||||
|
||||
if (bits == 16)
|
||||
{
|
||||
if (network_video_temp_buf)
|
||||
{
|
||||
if (frame_to_copy == network_menu_frame)
|
||||
{
|
||||
/* Scale and convert 16-bit RGBX4444 image to 32-bit RGBX8888. */
|
||||
unsigned x, y;
|
||||
|
||||
for (y = 0; y < network->screen_height; y++)
|
||||
{
|
||||
for (x = 0; x < network->screen_width; x++)
|
||||
{
|
||||
/* scale incoming frame to fit the screen */
|
||||
unsigned scaled_x = (width * x) / network->screen_width;
|
||||
unsigned scaled_y = (height * y) / network->screen_height;
|
||||
unsigned short pixel = ((unsigned short*)frame_to_copy)[width * scaled_y + scaled_x];
|
||||
|
||||
/* convert RGBX4444 to RGBX8888 */
|
||||
unsigned r = ((pixel & 0xF000) << 8) | ((pixel & 0xF000) << 4);
|
||||
unsigned g = ((pixel & 0x0F00) << 4) | ((pixel & 0x0F00) << 0);
|
||||
unsigned b = ((pixel & 0x00F0) << 0) | ((pixel & 0x00F0) >> 4);
|
||||
|
||||
network_video_temp_buf[network->screen_width * y + x] = 0xFF000000 | b | g | r;
|
||||
}
|
||||
}
|
||||
|
||||
pixfmt = NETWORK_VIDEO_PIXELFORMAT_RGBA8888;
|
||||
frame_to_copy = network_video_temp_buf;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Scale and convert 16-bit RGB565 image to 32-bit RGBX8888. */
|
||||
unsigned x, y;
|
||||
|
||||
for (y = 0; y < network->screen_height; y++)
|
||||
{
|
||||
for (x = 0; x < network->screen_width; x++)
|
||||
{
|
||||
/* scale incoming frame to fit the screen */
|
||||
unsigned scaled_x = (width * x) / network->screen_width;
|
||||
unsigned scaled_y = (height * y) / network->screen_height;
|
||||
unsigned short pixel = ((unsigned short*)frame_to_copy)[(pitch / (bits / 8)) * scaled_y + scaled_x];
|
||||
|
||||
/* convert RGB565 to RGBX8888 */
|
||||
unsigned r = ((pixel & 0x001F) << 3) | ((pixel & 0x001C) >> 2);
|
||||
unsigned g = ((pixel & 0x07E0) << 5) | ((pixel & 0x0600) >> 1);
|
||||
unsigned b = ((pixel & 0xF800) << 8) | ((pixel & 0xE000) << 3);
|
||||
|
||||
network_video_temp_buf[network->screen_width * y + x] = 0xFF000000 | b | g | r;
|
||||
}
|
||||
}
|
||||
|
||||
pixfmt = NETWORK_VIDEO_PIXELFORMAT_BGRA8888;
|
||||
frame_to_copy = network_video_temp_buf;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* no temp buffer available yet */
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Scale 32-bit RGBX8888 image to output geometry. */
|
||||
unsigned x, y;
|
||||
|
||||
for (y = 0; y < network->screen_height; y++)
|
||||
{
|
||||
for (x = 0; x < network->screen_width; x++)
|
||||
{
|
||||
/* scale incoming frame to fit the screen */
|
||||
unsigned scaled_x = (width * x) / network->screen_width;
|
||||
unsigned scaled_y = (height * y) / network->screen_height;
|
||||
unsigned pixel = ((unsigned*)frame_to_copy)[(pitch / (bits / 8)) * scaled_y + scaled_x];
|
||||
|
||||
network_video_temp_buf[network->screen_width * y + x] = pixel;
|
||||
}
|
||||
}
|
||||
|
||||
pixfmt = NETWORK_VIDEO_PIXELFORMAT_BGRA8888;
|
||||
frame_to_copy = network_video_temp_buf;
|
||||
}
|
||||
|
||||
if (draw && network->screen_width > 0 && network->screen_height > 0)
|
||||
{
|
||||
if (network->fd > 0)
|
||||
socket_send_all_blocking(network->fd, frame_to_copy, network->screen_width * network->screen_height * 4, true);
|
||||
}
|
||||
|
||||
if (msg)
|
||||
font_driver_render_msg(video_info, NULL, msg, NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void network_gfx_set_nonblock_state(void *data, bool toggle)
|
||||
{
|
||||
(void)data;
|
||||
(void)toggle;
|
||||
}
|
||||
|
||||
static bool network_gfx_alive(void *data)
|
||||
{
|
||||
gfx_ctx_size_t size_data;
|
||||
unsigned temp_width = 0;
|
||||
unsigned temp_height = 0;
|
||||
bool quit = false;
|
||||
bool resize = false;
|
||||
bool is_shutdown = rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL);
|
||||
network_video_t *network = (network_video_t*)data;
|
||||
|
||||
/* Needed because some context drivers don't track their sizes */
|
||||
video_driver_get_size(&temp_width, &temp_height);
|
||||
|
||||
network->ctx_driver->check_window(network->ctx_data,
|
||||
&quit, &resize, &temp_width, &temp_height, is_shutdown);
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
video_driver_set_size(&temp_width, &temp_height);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool network_gfx_focus(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool network_gfx_suppress_screensaver(void *data, bool enable)
|
||||
{
|
||||
(void)data;
|
||||
(void)enable;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool network_gfx_has_windowed(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void network_gfx_free(void *data)
|
||||
{
|
||||
network_video_t *network = (network_video_t*)data;
|
||||
|
||||
if (network_menu_frame)
|
||||
{
|
||||
free(network_menu_frame);
|
||||
network_menu_frame = NULL;
|
||||
}
|
||||
|
||||
if (network_video_temp_buf)
|
||||
{
|
||||
free(network_video_temp_buf);
|
||||
network_video_temp_buf = NULL;
|
||||
}
|
||||
|
||||
font_driver_free_osd();
|
||||
|
||||
if (network->fd >= 0)
|
||||
socket_close(network->fd);
|
||||
|
||||
if (network)
|
||||
free(network);
|
||||
}
|
||||
|
||||
static bool network_gfx_set_shader(void *data,
|
||||
enum rarch_shader_type type, const char *path)
|
||||
{
|
||||
(void)data;
|
||||
(void)type;
|
||||
(void)path;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void network_gfx_set_rotation(void *data,
|
||||
unsigned rotation)
|
||||
{
|
||||
(void)data;
|
||||
(void)rotation;
|
||||
}
|
||||
|
||||
static void network_set_texture_frame(void *data,
|
||||
const void *frame, bool rgb32, unsigned width, unsigned height,
|
||||
float alpha)
|
||||
{
|
||||
unsigned pitch = width * 2;
|
||||
|
||||
if (rgb32)
|
||||
pitch = width * 4;
|
||||
|
||||
if (network_menu_frame)
|
||||
{
|
||||
free(network_menu_frame);
|
||||
network_menu_frame = NULL;
|
||||
}
|
||||
|
||||
if (!network_menu_frame || network_menu_width != width || network_menu_height != height || network_menu_pitch != pitch)
|
||||
if (pitch && height)
|
||||
network_menu_frame = (unsigned char*)malloc(pitch * height);
|
||||
|
||||
if (network_menu_frame && frame && pitch && height)
|
||||
{
|
||||
memcpy(network_menu_frame, frame, pitch * height);
|
||||
network_menu_width = width;
|
||||
network_menu_height = height;
|
||||
network_menu_pitch = pitch;
|
||||
network_menu_bits = rgb32 ? 32 : 16;
|
||||
}
|
||||
}
|
||||
|
||||
static void network_set_osd_msg(void *data,
|
||||
video_frame_info_t *video_info,
|
||||
const char *msg,
|
||||
const void *params, void *font)
|
||||
{
|
||||
font_driver_render_msg(video_info, font, msg, (const struct font_params*)params);
|
||||
}
|
||||
|
||||
static void network_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 network_get_video_output_prev(void *data)
|
||||
{
|
||||
video_context_driver_get_video_output_prev();
|
||||
}
|
||||
|
||||
static void network_get_video_output_next(void *data)
|
||||
{
|
||||
video_context_driver_get_video_output_next();
|
||||
}
|
||||
|
||||
static void network_set_video_mode(void *data, unsigned width, unsigned height,
|
||||
bool fullscreen)
|
||||
{
|
||||
gfx_ctx_mode_t mode;
|
||||
|
||||
mode.width = width;
|
||||
mode.height = height;
|
||||
mode.fullscreen = fullscreen;
|
||||
|
||||
video_context_driver_set_video_mode(&mode);
|
||||
}
|
||||
|
||||
static const video_poke_interface_t network_poke_interface = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
network_set_video_mode,
|
||||
NULL,
|
||||
NULL,
|
||||
network_get_video_output_size,
|
||||
network_get_video_output_prev,
|
||||
network_get_video_output_next,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
#if defined(HAVE_MENU)
|
||||
network_set_texture_frame,
|
||||
NULL,
|
||||
network_set_osd_msg,
|
||||
NULL,
|
||||
#else
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
#endif
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static void network_gfx_get_poke_interface(void *data,
|
||||
const video_poke_interface_t **iface)
|
||||
{
|
||||
(void)data;
|
||||
*iface = &network_poke_interface;
|
||||
}
|
||||
|
||||
static void network_gfx_set_viewport(void *data, unsigned viewport_width,
|
||||
unsigned viewport_height, bool force_full, bool allow_rotate)
|
||||
{
|
||||
}
|
||||
|
||||
bool network_has_menu_frame(void)
|
||||
{
|
||||
return (network_menu_frame != NULL);
|
||||
}
|
||||
|
||||
video_driver_t video_network = {
|
||||
network_gfx_init,
|
||||
network_gfx_frame,
|
||||
network_gfx_set_nonblock_state,
|
||||
network_gfx_alive,
|
||||
network_gfx_focus,
|
||||
network_gfx_suppress_screensaver,
|
||||
network_gfx_has_windowed,
|
||||
network_gfx_set_shader,
|
||||
network_gfx_free,
|
||||
"network",
|
||||
network_gfx_set_viewport,
|
||||
network_gfx_set_rotation,
|
||||
NULL, /* viewport_info */
|
||||
NULL, /* read_viewport */
|
||||
NULL, /* read_frame_raw */
|
||||
#ifdef HAVE_OVERLAY
|
||||
NULL, /* overlay_interface */
|
||||
#endif
|
||||
#ifdef HAVE_VIDEO_LAYOUT
|
||||
NULL,
|
||||
#endif
|
||||
network_gfx_get_poke_interface,
|
||||
NULL /* wrap_type_to_enum */
|
||||
};
|
||||
@@ -99,8 +99,6 @@ static void init_ps2_video(ps2_video_t *ps2)
|
||||
|
||||
static void deinitTexture(GSTEXTURE *texture)
|
||||
{
|
||||
free(texture->Mem);
|
||||
free(texture->Clut);
|
||||
texture->Mem = NULL;
|
||||
texture->Clut = NULL;
|
||||
}
|
||||
@@ -369,6 +367,9 @@ static void ps2_gfx_free(void *data)
|
||||
deinitTexture(ps2->menuTexture);
|
||||
deinitTexture(ps2->coreTexture);
|
||||
|
||||
free(ps2->menuTexture);
|
||||
free(ps2->coreTexture);
|
||||
|
||||
gsKit_deinit_global(ps2->gsGlobal);
|
||||
|
||||
free(data);
|
||||
|
||||
+5
-36
@@ -471,20 +471,10 @@ static void *psp_init(const video_info_t *video,
|
||||
return psp;
|
||||
}
|
||||
|
||||
#if 0
|
||||
#define DISPLAY_FPS
|
||||
#endif
|
||||
|
||||
static bool psp_frame(void *data, const void *frame,
|
||||
unsigned width, unsigned height, uint64_t frame_count,
|
||||
unsigned pitch, const char *msg, video_frame_info_t *video_info)
|
||||
{
|
||||
#ifdef DISPLAY_FPS
|
||||
uint32_t diff;
|
||||
static uint64_t currentTick,lastTick;
|
||||
static int frames;
|
||||
static float fps = 0.0;
|
||||
#endif
|
||||
psp1_video_t *psp = (psp1_video_t*)data;
|
||||
|
||||
if (!width || !height)
|
||||
@@ -498,40 +488,19 @@ static bool psp_frame(void *data, const void *frame,
|
||||
if (!psp->hw_render)
|
||||
sceGuSync(0, 0); /* let the core decide when to sync when HW_RENDER */
|
||||
|
||||
pspDebugScreenSetBase(psp->draw_buffer);
|
||||
|
||||
pspDebugScreenSetXY(0,0);
|
||||
|
||||
if (video_info->fps_show)
|
||||
if (msg)
|
||||
{
|
||||
pspDebugScreenSetXY(68 - strlen(video_info->fps_text) - 1,0);
|
||||
pspDebugScreenPuts(video_info->fps_text);
|
||||
pspDebugScreenSetXY(0,1);
|
||||
}
|
||||
|
||||
if (msg)
|
||||
pspDebugScreenSetBase(psp->draw_buffer);
|
||||
pspDebugScreenSetXY(0,0);
|
||||
pspDebugScreenPuts(msg);
|
||||
}
|
||||
|
||||
|
||||
if ((psp->vsync)&&(psp->vblank_not_reached))
|
||||
sceDisplayWaitVblankStart();
|
||||
|
||||
psp->vblank_not_reached = true;
|
||||
|
||||
#ifdef DISPLAY_FPS
|
||||
frames++;
|
||||
sceRtcGetCurrentTick(¤tTick);
|
||||
diff = currentTick - lastTick;
|
||||
if(diff > 1000000)
|
||||
{
|
||||
fps = (float)frames * 1000000.0 / diff;
|
||||
lastTick = currentTick;
|
||||
frames = 0;
|
||||
}
|
||||
|
||||
pspDebugScreenSetXY(0,0);
|
||||
pspDebugScreenPrintf("%f", fps);
|
||||
#endif
|
||||
|
||||
psp->draw_buffer = FROM_GU_POINTER(sceGuSwapBuffers());
|
||||
|
||||
if (psp->should_resize)
|
||||
|
||||
+12
-24
@@ -36,6 +36,10 @@
|
||||
#include "SDL.h"
|
||||
#include "SDL_syswm.h"
|
||||
|
||||
#ifdef HAVE_SDL2
|
||||
#include "../common/sdl2_common.h"
|
||||
#endif
|
||||
|
||||
#include "../font_driver.h"
|
||||
|
||||
#include "../../configuration.h"
|
||||
@@ -211,28 +215,6 @@ static void sdl2_render_msg(sdl2_video_t *vid, const char *msg)
|
||||
}
|
||||
}
|
||||
|
||||
static void sdl2_gfx_set_handles(sdl2_video_t *vid)
|
||||
{
|
||||
/* SysWMinfo headers are broken on OSX. */
|
||||
#if defined(_WIN32) || defined(HAVE_X11)
|
||||
SDL_SysWMinfo info;
|
||||
SDL_VERSION(&info.version);
|
||||
|
||||
if (SDL_GetWindowWMInfo(vid->window, &info) != 1)
|
||||
return;
|
||||
|
||||
#if defined(_WIN32)
|
||||
video_driver_display_type_set(RARCH_DISPLAY_WIN32);
|
||||
video_driver_display_set(0);
|
||||
video_driver_window_set((uintptr_t)info.info.win.window);
|
||||
#elif defined(HAVE_X11)
|
||||
video_driver_display_type_set(RARCH_DISPLAY_X11);
|
||||
video_driver_display_set((uintptr_t)info.info.x11.display);
|
||||
video_driver_window_set((uintptr_t)info.info.x11.window);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static void sdl2_init_renderer(sdl2_video_t *vid)
|
||||
{
|
||||
unsigned flags = SDL_RENDERER_ACCELERATED;
|
||||
@@ -448,7 +430,13 @@ static void *sdl2_gfx_init(const video_info_t *video,
|
||||
sdl2_init_renderer(vid);
|
||||
sdl2_init_font(vid, settings->paths.path_font, settings->floats.video_font_size);
|
||||
|
||||
sdl2_gfx_set_handles(vid);
|
||||
#if defined(_WIN32)
|
||||
sdl2_set_handles(vid->window, RARCH_DISPLAY_WIN32);
|
||||
#elif defined(HAVE_X11)
|
||||
sdl2_set_handles(vid->window, RARCH_DISPLAY_X11);
|
||||
#elif defined(HAVE_COCOA)
|
||||
sdl2_set_handles(vid->window, RARCH_DISPLAY_OSX);
|
||||
#endif
|
||||
|
||||
sdl_refresh_viewport(vid);
|
||||
|
||||
@@ -522,7 +510,7 @@ static bool sdl2_gfx_frame(void *data, const void *frame, unsigned width,
|
||||
video_driver_get_window_title(title, sizeof(title));
|
||||
|
||||
if (title[0])
|
||||
SDL_SetWindowTitle(vid->window, title);
|
||||
SDL_SetWindowTitle((SDL_Window*)video_driver_display_userdata_get(), title);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1179,6 +1179,8 @@ static void *vulkan_init(const video_info_t *video,
|
||||
vk->ctx_driver = ctx_driver;
|
||||
|
||||
video_context_driver_set((const gfx_ctx_driver_t*)ctx_driver);
|
||||
|
||||
RARCH_LOG("[Vulkan]: Found vulkan context: %s\n", ctx_driver->ident);
|
||||
|
||||
video_context_driver_get_video_size(&mode);
|
||||
full_x = mode.width;
|
||||
|
||||
@@ -437,10 +437,29 @@ static bool android_gfx_ctx_suppress_screensaver(void *data, bool enable)
|
||||
|
||||
static void dpi_get_density(char *s, size_t len)
|
||||
{
|
||||
system_property_get("getprop", "ro.sf.lcd_density", s);
|
||||
static bool inited_once = false;
|
||||
static bool inited2_once = false;
|
||||
static char string[PROP_VALUE_MAX] = {0};
|
||||
static char string2[PROP_VALUE_MAX] = {0};
|
||||
if (!inited_once)
|
||||
{
|
||||
system_property_get("getprop", "ro.sf.lcd_density", string);
|
||||
inited_once = true;
|
||||
}
|
||||
|
||||
if (string_is_empty(s))
|
||||
system_property_get("wm", "density", s);
|
||||
if (!string_is_empty(string))
|
||||
{
|
||||
strlcpy(s, string, len);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!inited2_once)
|
||||
{
|
||||
system_property_get("wm", "density", string2);
|
||||
inited2_once = true;
|
||||
}
|
||||
|
||||
strlcpy(s, string2, len);
|
||||
}
|
||||
|
||||
static bool android_gfx_ctx_get_metrics(void *data,
|
||||
@@ -615,26 +634,6 @@ static void android_gfx_ctx_set_flags(void *data, uint32_t flags)
|
||||
(void)flags;
|
||||
}
|
||||
|
||||
static void android_gfx_update_window_title(void *data, void *data2)
|
||||
{
|
||||
const settings_t *settings = config_get_ptr();
|
||||
video_frame_info_t* video_info = (video_frame_info_t*)data2;
|
||||
|
||||
if (settings->bools.video_memory_show)
|
||||
{
|
||||
uint64_t mem_bytes_used = frontend_driver_get_used_memory();
|
||||
uint64_t mem_bytes_total = frontend_driver_get_total_memory();
|
||||
char mem[128];
|
||||
|
||||
mem[0] = '\0';
|
||||
|
||||
snprintf(
|
||||
mem, sizeof(mem), " || MEM: %.2f/%.2fMB", mem_bytes_used / (1024.0f * 1024.0f),
|
||||
mem_bytes_total / (1024.0f * 1024.0f));
|
||||
strlcat(video_info->fps_text, mem, sizeof(video_info->fps_text));
|
||||
}
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_android = {
|
||||
android_gfx_ctx_init,
|
||||
android_gfx_ctx_destroy,
|
||||
@@ -649,7 +648,7 @@ const gfx_ctx_driver_t gfx_ctx_android = {
|
||||
NULL, /* get_video_output_next */
|
||||
android_gfx_ctx_get_metrics,
|
||||
NULL,
|
||||
android_gfx_update_window_title,
|
||||
NULL, /* update_title */
|
||||
android_gfx_ctx_check_window,
|
||||
android_gfx_ctx_set_resize,
|
||||
android_gfx_ctx_has_focus,
|
||||
|
||||
@@ -44,6 +44,9 @@
|
||||
#ifdef HAVE_VULKAN
|
||||
#include "../common/vulkan_common.h"
|
||||
#endif
|
||||
#ifdef HAVE_METAL
|
||||
#include "../common/metal_common.h"
|
||||
#endif
|
||||
|
||||
typedef struct cocoa_ctx_data
|
||||
{
|
||||
@@ -90,8 +93,26 @@ static unsigned g_major = 0;
|
||||
@end
|
||||
#endif
|
||||
|
||||
/* forward declaration */
|
||||
void *nsview_get_ptr(void);
|
||||
static CocoaView* g_instance;
|
||||
|
||||
void *nsview_get_ptr(void)
|
||||
{
|
||||
#if defined(HAVE_COCOA)
|
||||
video_driver_display_type_set(RARCH_DISPLAY_OSX);
|
||||
video_driver_display_set(0);
|
||||
video_driver_display_userdata_set((uintptr_t)g_instance);
|
||||
#elif defined(HAVE_COCOA_METAL)
|
||||
video_driver_display_type_set(RARCH_DISPLAY_OSX);
|
||||
video_driver_display_set(0);
|
||||
video_driver_display_userdata_set((uintptr_t)g_instance);
|
||||
#endif
|
||||
return (BRIDGE void *)g_instance;
|
||||
}
|
||||
|
||||
void nsview_set_ptr(CocoaView *p)
|
||||
{
|
||||
g_instance = p;
|
||||
}
|
||||
|
||||
#if defined(HAVE_COCOA) || defined(HAVE_COCOA_METAL)
|
||||
static NSOpenGLPixelFormat* g_format;
|
||||
@@ -228,7 +249,7 @@ float get_backing_scale_factor(void)
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
NSView *g_view = apple_platform.renderView;
|
||||
#elif defined(HAVE_COCOA)
|
||||
CocoaView *g_view = (CocoaView*)nsview_get_ptr();
|
||||
CocoaView *g_view = g_instance;
|
||||
#endif
|
||||
backing_scale_def = (float)get_from_selector
|
||||
([[g_view window] class], [g_view window], selector, &ret);
|
||||
@@ -348,15 +369,8 @@ float cocoagl_gfx_ctx_get_native_scale(void)
|
||||
#if defined(HAVE_COCOA) || defined(HAVE_COCOA_METAL)
|
||||
static void cocoagl_gfx_ctx_update_title(void *data, void *data2)
|
||||
{
|
||||
ui_window_cocoa_t view;
|
||||
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
||||
|
||||
#if defined(HAVE_COCOA)
|
||||
view.data = (CocoaView*)nsview_get_ptr();
|
||||
#elif defined(HAVE_COCOA_METAL)
|
||||
view.data = (BRIDGE void *)apple_platform.renderView;
|
||||
#endif
|
||||
|
||||
|
||||
if (window)
|
||||
{
|
||||
char title[128];
|
||||
@@ -366,7 +380,7 @@ static void cocoagl_gfx_ctx_update_title(void *data, void *data2)
|
||||
video_driver_get_window_title(title, sizeof(title));
|
||||
|
||||
if (title[0])
|
||||
window->set_title(&view, title);
|
||||
window->set_title((void*)video_driver_display_userdata_get(), title);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -466,19 +480,20 @@ static void cocoagl_gfx_ctx_get_video_size(void *data, unsigned* width, unsigned
|
||||
{
|
||||
float screenscale = cocoagl_gfx_ctx_get_native_scale();
|
||||
#if defined(HAVE_COCOA) || defined(HAVE_COCOA_METAL)
|
||||
CGRect size;
|
||||
CGRect size, cgrect;
|
||||
GLsizei backingPixelWidth, backingPixelHeight;
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
NSView *g_view = apple_platform.renderView;
|
||||
#elif defined(HAVE_COCOA)
|
||||
CocoaView *g_view = (CocoaView*)nsview_get_ptr();
|
||||
CocoaView *g_view = g_instance;
|
||||
#endif
|
||||
CGRect cgrect = NSRectToCGRect([g_view frame]);
|
||||
#if MAC_OS_X_VERSION_10_7
|
||||
SEL selector = NSSelectorFromString(BOXSTRING("convertRectToBacking:"));
|
||||
if ([g_view respondsToSelector:selector])
|
||||
cgrect = NSRectToCGRect([g_view convertRectToBacking:[g_view bounds]]);
|
||||
else
|
||||
#endif
|
||||
cgrect = NSRectToCGRect([g_view frame]);
|
||||
backingPixelWidth = CGRectGetWidth(cgrect);
|
||||
backingPixelHeight = CGRectGetHeight(cgrect);
|
||||
size = CGRectMake(0, 0, backingPixelWidth, backingPixelHeight);
|
||||
|
||||
@@ -928,26 +928,6 @@ static void gfx_ctx_drm_set_flags(void *data, uint32_t flags)
|
||||
drm->core_hw_context_enable = true;
|
||||
}
|
||||
|
||||
void gfx_ctx_drm_update_window_title(void *data, void *data2)
|
||||
{
|
||||
const settings_t *settings = config_get_ptr();
|
||||
video_frame_info_t* video_info = (video_frame_info_t*)data2;
|
||||
|
||||
if (settings->bools.video_memory_show)
|
||||
{
|
||||
uint64_t mem_bytes_used = frontend_driver_get_used_memory();
|
||||
uint64_t mem_bytes_total = frontend_driver_get_total_memory();
|
||||
char mem[128];
|
||||
|
||||
mem[0] = '\0';
|
||||
|
||||
snprintf(
|
||||
mem, sizeof(mem), " || MEM: %.2f/%.2fMB", mem_bytes_used / (1024.0f * 1024.0f),
|
||||
mem_bytes_total / (1024.0f * 1024.0f));
|
||||
strlcat(video_info->fps_text, mem, sizeof(video_info->fps_text));
|
||||
}
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_drm = {
|
||||
gfx_ctx_drm_init,
|
||||
gfx_ctx_drm_destroy,
|
||||
@@ -962,7 +942,7 @@ const gfx_ctx_driver_t gfx_ctx_drm = {
|
||||
NULL, /* get_video_output_next */
|
||||
NULL, /* get_metrics */
|
||||
NULL,
|
||||
gfx_ctx_drm_update_window_title,
|
||||
NULL, /* update_title */
|
||||
gfx_ctx_drm_check_window,
|
||||
NULL, /* set_resize */
|
||||
gfx_ctx_drm_has_focus,
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2016-2017 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* FPGA context. */
|
||||
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
#endif
|
||||
|
||||
#include "../../configuration.h"
|
||||
#include "../../dynamic.h"
|
||||
#include "../../verbosity.h"
|
||||
#include "../video_driver.h"
|
||||
#include "../common/fpga_common.h"
|
||||
|
||||
static unsigned g_resize_width = FB_WIDTH;
|
||||
static unsigned g_resize_height = FB_HEIGHT;
|
||||
|
||||
static void gfx_ctx_fpga_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height, bool is_shutdown)
|
||||
{
|
||||
}
|
||||
|
||||
static bool gfx_ctx_fpga_set_resize(void *data,
|
||||
unsigned width, unsigned height)
|
||||
{
|
||||
(void)data;
|
||||
(void)width;
|
||||
(void)height;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void gfx_ctx_fpga_update_title(void *data, void *data2)
|
||||
{
|
||||
char title[128];
|
||||
|
||||
title[0] = '\0';
|
||||
|
||||
video_driver_get_window_title(title, sizeof(title));
|
||||
}
|
||||
|
||||
static void gfx_ctx_fpga_get_video_size(void *data,
|
||||
unsigned *width, unsigned *height)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
*width = g_resize_width;
|
||||
*height = g_resize_height;
|
||||
}
|
||||
|
||||
static void *gfx_ctx_fpga_init(video_frame_info_t *video_info, void *video_driver)
|
||||
{
|
||||
(void)video_driver;
|
||||
|
||||
return (void*)"fpga";
|
||||
}
|
||||
|
||||
static void gfx_ctx_fpga_destroy(void *data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_fpga_set_video_mode(void *data,
|
||||
video_frame_info_t *video_info,
|
||||
unsigned width, unsigned height,
|
||||
bool fullscreen)
|
||||
{
|
||||
if (false)
|
||||
goto error;
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
gfx_ctx_fpga_destroy(data);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static void gfx_ctx_fpga_input_driver(void *data,
|
||||
const char *joypad_name,
|
||||
const input_driver_t **input, void **input_data)
|
||||
{
|
||||
(void)data;
|
||||
settings_t *settings = config_get_ptr();
|
||||
}
|
||||
|
||||
static bool gfx_ctx_fpga_has_focus(void *data)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_fpga_suppress_screensaver(void *data, bool enable)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_fpga_has_windowed(void *data)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_fpga_get_metrics(void *data,
|
||||
enum display_metric_types type, float *value)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_fpga_bind_api(void *data,
|
||||
enum gfx_ctx_api api, unsigned major, unsigned minor)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void gfx_ctx_fpga_show_mouse(void *data, bool state)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void gfx_ctx_fpga_swap_interval(void *data, unsigned interval)
|
||||
{
|
||||
(void)data;
|
||||
(void)interval;
|
||||
}
|
||||
|
||||
static void gfx_ctx_fpga_set_flags(void *data, uint32_t flags)
|
||||
{
|
||||
(void)data;
|
||||
(void)flags;
|
||||
}
|
||||
|
||||
static uint32_t gfx_ctx_fpga_get_flags(void *data)
|
||||
{
|
||||
uint32_t flags = 0;
|
||||
BIT32_SET(flags, GFX_CTX_FLAGS_NONE);
|
||||
return flags;
|
||||
}
|
||||
|
||||
static void gfx_ctx_fpga_swap_buffers(void *data, void *data2)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_fpga = {
|
||||
gfx_ctx_fpga_init,
|
||||
gfx_ctx_fpga_destroy,
|
||||
gfx_ctx_fpga_bind_api,
|
||||
gfx_ctx_fpga_swap_interval,
|
||||
gfx_ctx_fpga_set_video_mode,
|
||||
gfx_ctx_fpga_get_video_size,
|
||||
NULL, /* get_video_output_size */
|
||||
NULL, /* get_video_output_prev */
|
||||
NULL, /* get_video_output_next */
|
||||
gfx_ctx_fpga_get_metrics,
|
||||
NULL,
|
||||
gfx_ctx_fpga_update_title,
|
||||
gfx_ctx_fpga_check_window,
|
||||
gfx_ctx_fpga_set_resize,
|
||||
gfx_ctx_fpga_has_focus,
|
||||
gfx_ctx_fpga_suppress_screensaver,
|
||||
gfx_ctx_fpga_has_windowed,
|
||||
gfx_ctx_fpga_swap_buffers,
|
||||
gfx_ctx_fpga_input_driver,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
gfx_ctx_fpga_show_mouse,
|
||||
"fpga",
|
||||
gfx_ctx_fpga_get_flags,
|
||||
gfx_ctx_fpga_set_flags,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -68,31 +68,14 @@ static bool gfx_ctx_gdi_set_resize(void *data,
|
||||
return false;
|
||||
}
|
||||
|
||||
static void gfx_ctx_gdi_update_window_title(void *data, void *data2)
|
||||
static void gfx_ctx_gdi_update_title(void *data, void *data2)
|
||||
{
|
||||
const settings_t *settings = config_get_ptr();
|
||||
video_frame_info_t* video_info = (video_frame_info_t*)data2;
|
||||
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
||||
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
||||
char title[128];
|
||||
|
||||
title[0] = '\0';
|
||||
|
||||
if (settings->bools.video_memory_show)
|
||||
{
|
||||
#ifndef __WINRT__
|
||||
int64_t mem_bytes_used = frontend_driver_get_used_memory();
|
||||
int64_t mem_bytes_total = frontend_driver_get_total_memory();
|
||||
char mem[128];
|
||||
|
||||
mem[0] = '\0';
|
||||
|
||||
snprintf(
|
||||
mem, sizeof(mem), " || MEM: %.2f/%.2fMB", mem_bytes_used / (1024.0f * 1024.0f),
|
||||
mem_bytes_total / (1024.0f * 1024.0f));
|
||||
strlcat(video_info->fps_text, mem, sizeof(video_info->fps_text));
|
||||
#endif
|
||||
}
|
||||
|
||||
video_driver_get_window_title(title, sizeof(title));
|
||||
|
||||
if (window && title[0])
|
||||
@@ -305,7 +288,7 @@ const gfx_ctx_driver_t gfx_ctx_gdi = {
|
||||
NULL, /* get_video_output_next */
|
||||
win32_get_metrics,
|
||||
NULL,
|
||||
gfx_ctx_gdi_update_window_title,
|
||||
gfx_ctx_gdi_update_title,
|
||||
gfx_ctx_gdi_check_window,
|
||||
gfx_ctx_gdi_set_resize,
|
||||
gfx_ctx_gdi_has_focus,
|
||||
|
||||
@@ -276,26 +276,6 @@ static void *gfx_ctx_khr_display_get_context_data(void *data)
|
||||
return &khr->vk.context;
|
||||
}
|
||||
|
||||
static void gfx_ctx_khr_display_update_window_title(void *data, void *data2)
|
||||
{
|
||||
const settings_t *settings = config_get_ptr();
|
||||
video_frame_info_t *video_info = (video_frame_info_t*)data2;
|
||||
|
||||
if (settings->bools.video_memory_show)
|
||||
{
|
||||
uint64_t mem_bytes_used = frontend_driver_get_used_memory();
|
||||
uint64_t mem_bytes_total = frontend_driver_get_total_memory();
|
||||
char mem[128];
|
||||
|
||||
mem[0] = '\0';
|
||||
|
||||
snprintf(
|
||||
mem, sizeof(mem), " || MEM: %.2f/%.2fMB", mem_bytes_used / (1024.0f * 1024.0f),
|
||||
mem_bytes_total / (1024.0f * 1024.0f));
|
||||
strlcat(video_info->fps_text, mem, sizeof(video_info->fps_text));
|
||||
}
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_khr_display = {
|
||||
gfx_ctx_khr_display_init,
|
||||
gfx_ctx_khr_display_destroy,
|
||||
@@ -310,7 +290,7 @@ const gfx_ctx_driver_t gfx_ctx_khr_display = {
|
||||
NULL, /* get_video_output_next */
|
||||
NULL, /* get_metrics */
|
||||
NULL,
|
||||
gfx_ctx_khr_display_update_window_title,
|
||||
NULL, /* update_title */
|
||||
gfx_ctx_khr_display_check_window,
|
||||
gfx_ctx_khr_display_set_resize,
|
||||
gfx_ctx_khr_display_has_focus,
|
||||
|
||||
@@ -305,26 +305,6 @@ static float gfx_ctx_mali_fbdev_get_refresh_rate(void *data)
|
||||
return mali->refresh_rate;
|
||||
}
|
||||
|
||||
static void gfx_ctx_mali_fbdev_update_window_title(void *data, void *data2)
|
||||
{
|
||||
const settings_t *settings = config_get_ptr();
|
||||
video_frame_info_t* video_info = (video_frame_info_t*)data2;
|
||||
|
||||
if (settings->bools.video_memory_show)
|
||||
{
|
||||
uint64_t mem_bytes_used = frontend_driver_get_used_memory();
|
||||
uint64_t mem_bytes_total = frontend_driver_get_total_memory();
|
||||
char mem[128];
|
||||
|
||||
mem[0] = '\0';
|
||||
|
||||
snprintf(
|
||||
mem, sizeof(mem), " || MEM: %.2f/%.2fMB", mem_bytes_used / (1024.0f * 1024.0f),
|
||||
mem_bytes_total / (1024.0f * 1024.0f));
|
||||
strlcat(video_info->fps_text, mem, sizeof(video_info->fps_text));
|
||||
}
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_mali_fbdev = {
|
||||
gfx_ctx_mali_fbdev_init,
|
||||
gfx_ctx_mali_fbdev_destroy,
|
||||
@@ -339,7 +319,7 @@ const gfx_ctx_driver_t gfx_ctx_mali_fbdev = {
|
||||
NULL, /* get_video_output_next */
|
||||
NULL, /* get_metrics */
|
||||
NULL,
|
||||
gfx_ctx_mali_fbdev_update_window_title,
|
||||
NULL, /* update_title */
|
||||
gfx_ctx_mali_fbdev_check_window,
|
||||
NULL, /* set_resize */
|
||||
gfx_ctx_mali_fbdev_has_focus,
|
||||
|
||||
@@ -0,0 +1,191 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2016-2019 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* network video context. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
#endif
|
||||
|
||||
#include "../../configuration.h"
|
||||
#include "../../dynamic.h"
|
||||
#include "../../retroarch.h"
|
||||
#include "../../verbosity.h"
|
||||
#include "../../ui/ui_companion_driver.h"
|
||||
|
||||
#if defined(_WIN32) && !defined(_XBOX)
|
||||
#include "../common/win32_common.h"
|
||||
#endif
|
||||
|
||||
static enum gfx_ctx_api network_ctx_api = GFX_CTX_NONE;
|
||||
|
||||
static void gfx_ctx_network_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height, bool is_shutdown)
|
||||
{
|
||||
}
|
||||
|
||||
static bool gfx_ctx_network_set_resize(void *data,
|
||||
unsigned width, unsigned height)
|
||||
{
|
||||
(void)data;
|
||||
(void)width;
|
||||
(void)height;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void gfx_ctx_network_update_window_title(void *data, void *data2)
|
||||
{
|
||||
}
|
||||
|
||||
static void gfx_ctx_network_get_video_size(void *data,
|
||||
unsigned *width, unsigned *height)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void *gfx_ctx_network_init(
|
||||
video_frame_info_t *video_info, void *video_driver)
|
||||
{
|
||||
(void)video_driver;
|
||||
|
||||
return (void*)"network";
|
||||
}
|
||||
|
||||
static void gfx_ctx_network_destroy(void *data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_network_set_video_mode(void *data,
|
||||
video_frame_info_t *video_info,
|
||||
unsigned width, unsigned height,
|
||||
bool fullscreen)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static void gfx_ctx_network_input_driver(void *data,
|
||||
const char *joypad_name,
|
||||
input_driver_t **input, void **input_data)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
#ifdef HAVE_UDEV
|
||||
*input_data = input_udev.init(joypad_name);
|
||||
|
||||
if (*input_data)
|
||||
{
|
||||
*input = &input_udev;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
*input = NULL;
|
||||
*input_data = NULL;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_network_has_focus(void *data)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_network_suppress_screensaver(void *data, bool enable)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_network_get_metrics(void *data,
|
||||
enum display_metric_types type, float *value)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static enum gfx_ctx_api gfx_ctx_network_get_api(void *data)
|
||||
{
|
||||
return network_ctx_api;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_network_bind_api(void *data,
|
||||
enum gfx_ctx_api api, unsigned major, unsigned minor)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void gfx_ctx_network_show_mouse(void *data, bool state)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void gfx_ctx_network_swap_interval(void *data, int interval)
|
||||
{
|
||||
(void)data;
|
||||
(void)interval;
|
||||
}
|
||||
|
||||
static void gfx_ctx_network_set_flags(void *data, uint32_t flags)
|
||||
{
|
||||
(void)data;
|
||||
(void)flags;
|
||||
}
|
||||
|
||||
static uint32_t gfx_ctx_network_get_flags(void *data)
|
||||
{
|
||||
uint32_t flags = 0;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
static void gfx_ctx_network_swap_buffers(void *data, void *data2)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_network = {
|
||||
gfx_ctx_network_init,
|
||||
gfx_ctx_network_destroy,
|
||||
gfx_ctx_network_get_api,
|
||||
gfx_ctx_network_bind_api,
|
||||
gfx_ctx_network_swap_interval,
|
||||
gfx_ctx_network_set_video_mode,
|
||||
gfx_ctx_network_get_video_size,
|
||||
NULL, /* get_refresh_rate */
|
||||
NULL, /* get_video_output_size */
|
||||
NULL, /* get_video_output_prev */
|
||||
NULL, /* get_video_output_next */
|
||||
gfx_ctx_network_get_metrics,
|
||||
NULL,
|
||||
gfx_ctx_network_update_window_title,
|
||||
gfx_ctx_network_check_window,
|
||||
gfx_ctx_network_set_resize,
|
||||
gfx_ctx_network_has_focus,
|
||||
gfx_ctx_network_suppress_screensaver,
|
||||
true, /* has_windowed */
|
||||
gfx_ctx_network_swap_buffers,
|
||||
gfx_ctx_network_input_driver,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
gfx_ctx_network_show_mouse,
|
||||
"network",
|
||||
gfx_ctx_network_get_flags,
|
||||
gfx_ctx_network_set_flags,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
@@ -287,26 +287,6 @@ static float orbis_ctx_get_refresh_rate(void *data)
|
||||
return ctx_orbis->refresh_rate;
|
||||
}
|
||||
|
||||
static void orbis_ctx_update_window_title(void *data, void *data2)
|
||||
{
|
||||
const settings_t *settings = config_get_ptr();
|
||||
video_frame_info_t* video_info = (video_frame_info_t*)data2;
|
||||
|
||||
if (settings->bools.video_memory_show)
|
||||
{
|
||||
uint64_t mem_bytes_used = frontend_driver_get_used_memory();
|
||||
uint64_t mem_bytes_total = frontend_driver_get_total_memory();
|
||||
char mem[128];
|
||||
|
||||
mem[0] = '\0';
|
||||
|
||||
snprintf(
|
||||
mem, sizeof(mem), " || MEM: %.2f/%.2fMB", mem_bytes_used / (1024.0f * 1024.0f),
|
||||
mem_bytes_total / (1024.0f * 1024.0f));
|
||||
strlcat(video_info->fps_text, mem, sizeof(video_info->fps_text));
|
||||
}
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t orbis_ctx = {
|
||||
orbis_ctx_init,
|
||||
orbis_ctx_destroy,
|
||||
@@ -321,7 +301,7 @@ const gfx_ctx_driver_t orbis_ctx = {
|
||||
NULL, /* get_video_output_next */
|
||||
NULL, /* get_metrics */
|
||||
NULL,
|
||||
orbis_ctx_update_window_title,
|
||||
NULL, /* update_title */
|
||||
orbis_ctx_check_window,
|
||||
NULL, /* set_resize */
|
||||
orbis_ctx_has_focus,
|
||||
|
||||
@@ -409,26 +409,6 @@ static void gfx_ctx_ps3_set_flags(void *data, uint32_t flags)
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void gfx_ctx_ps3_update_window_title(void *data, void *data2)
|
||||
{
|
||||
const settings_t *settings = config_get_ptr();
|
||||
video_frame_info_t* video_info = (video_frame_info_t*)data2;
|
||||
|
||||
if (settings->bools.video_memory_show)
|
||||
{
|
||||
uint64_t mem_bytes_used = frontend_driver_get_used_memory();
|
||||
uint64_t mem_bytes_total = frontend_driver_get_total_memory();
|
||||
char mem[128];
|
||||
|
||||
mem[0] = '\0';
|
||||
|
||||
snprintf(
|
||||
mem, sizeof(mem), " || MEM: %.2f/%.2fMB", mem_bytes_used / (1024.0f * 1024.0f),
|
||||
mem_bytes_total / (1024.0f * 1024.0f));
|
||||
strlcat(video_info->fps_text, mem, sizeof(video_info->fps_text));
|
||||
}
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_ps3 = {
|
||||
gfx_ctx_ps3_init,
|
||||
gfx_ctx_ps3_destroy,
|
||||
@@ -443,7 +423,7 @@ const gfx_ctx_driver_t gfx_ctx_ps3 = {
|
||||
gfx_ctx_ps3_get_video_output_next,
|
||||
NULL, /* get_metrics */
|
||||
NULL,
|
||||
gfx_ctx_ps3_update_window_title,
|
||||
NULL, /* update_title */
|
||||
gfx_ctx_ps3_check_window,
|
||||
NULL, /* set_resize */
|
||||
gfx_ctx_ps3_has_focus,
|
||||
|
||||
@@ -28,6 +28,10 @@
|
||||
|
||||
#include "SDL.h"
|
||||
|
||||
#ifdef HAVE_SDL2
|
||||
#include "../common/sdl2_common.h"
|
||||
#endif
|
||||
|
||||
static enum gfx_ctx_api sdl_api = GFX_CTX_OPENGL_API;
|
||||
static unsigned g_major = 2;
|
||||
static unsigned g_minor = 1;
|
||||
@@ -214,6 +218,14 @@ static bool sdl_ctx_set_video_mode(void *data,
|
||||
goto error;
|
||||
|
||||
#ifdef HAVE_SDL2
|
||||
#if defined(_WIN32)
|
||||
sdl2_set_handles(sdl->g_win, RARCH_DISPLAY_WIN32);
|
||||
#elif defined(HAVE_X11)
|
||||
sdl2_set_handles(sdl->g_win, RARCH_DISPLAY_X11);
|
||||
#elif defined(HAVE_COCOA)
|
||||
sdl2_set_handles(sdl->g_win, RARCH_DISPLAY_OSX);
|
||||
#endif
|
||||
|
||||
if (sdl->g_ctx)
|
||||
video_driver_set_video_cache_context_ack();
|
||||
else
|
||||
@@ -276,20 +288,18 @@ static void sdl_ctx_get_video_size(void *data,
|
||||
static void sdl_ctx_update_title(void *data, void *data2)
|
||||
{
|
||||
char title[128];
|
||||
|
||||
title[0] = '\0';
|
||||
|
||||
video_driver_get_window_title(title, sizeof(title));
|
||||
|
||||
#ifdef HAVE_SDL2
|
||||
gfx_ctx_sdl_data_t *sdl = (gfx_ctx_sdl_data_t*)data;
|
||||
|
||||
if (sdl && title[0])
|
||||
SDL_SetWindowTitle(sdl->g_win, title);
|
||||
#else
|
||||
if (title[0])
|
||||
{
|
||||
#ifdef HAVE_SDL2
|
||||
SDL_SetWindowTitle((SDL_Window*)video_driver_display_userdata_get(), title);
|
||||
#else
|
||||
SDL_WM_SetCaption(title, NULL);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static void sdl_ctx_check_window(void *data, bool *quit,
|
||||
|
||||
@@ -48,37 +48,6 @@ static bool gfx_ctx_sixel_set_resize(void *data,
|
||||
return false;
|
||||
}
|
||||
|
||||
static void gfx_ctx_sixel_update_window_title(void *data, void *data2)
|
||||
{
|
||||
const settings_t *settings = config_get_ptr();
|
||||
video_frame_info_t *video_info = (video_frame_info_t*)data2;
|
||||
#if defined(_WIN32) && !defined(_XBOX)
|
||||
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
||||
char title[128];
|
||||
|
||||
title[0] = '\0';
|
||||
|
||||
if (settings->bools.video_memory_show)
|
||||
{
|
||||
uint64_t mem_bytes_used = frontend_driver_get_used_memory();
|
||||
uint64_t mem_bytes_total = frontend_driver_get_total_memory();
|
||||
char mem[128];
|
||||
|
||||
mem[0] = '\0';
|
||||
|
||||
snprintf(
|
||||
mem, sizeof(mem), " || MEM: %.2f/%.2fMB", mem_bytes_used / (1024.0f * 1024.0f),
|
||||
mem_bytes_total / (1024.0f * 1024.0f));
|
||||
strlcat(video_info->fps_text, mem, sizeof(video_info->fps_text));
|
||||
}
|
||||
|
||||
video_driver_get_window_title(title, sizeof(title));
|
||||
|
||||
if (window && title[0])
|
||||
window->set_title(&main_window, title);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void gfx_ctx_sixel_get_video_size(void *data,
|
||||
unsigned *width, unsigned *height)
|
||||
{
|
||||
@@ -197,7 +166,7 @@ const gfx_ctx_driver_t gfx_ctx_sixel = {
|
||||
NULL, /* get_video_output_next */
|
||||
gfx_ctx_sixel_get_metrics,
|
||||
NULL,
|
||||
gfx_ctx_sixel_update_window_title,
|
||||
NULL, /* update_title */
|
||||
gfx_ctx_sixel_check_window,
|
||||
gfx_ctx_sixel_set_resize,
|
||||
gfx_ctx_sixel_has_focus,
|
||||
|
||||
@@ -1158,23 +1158,19 @@ static void gfx_ctx_wl_update_title(void *data, void *data2)
|
||||
|
||||
if (wl && title[0])
|
||||
{
|
||||
if (wl->xdg_toplevel)
|
||||
if (wl->xdg_toplevel || wl->zxdg_toplevel)
|
||||
{
|
||||
if (wl->deco)
|
||||
if (wl->deco)
|
||||
{
|
||||
zxdg_toplevel_decoration_v1_set_mode(wl->deco, ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
|
||||
}
|
||||
xdg_toplevel_set_title(wl->xdg_toplevel, title);
|
||||
}
|
||||
else if (wl->zxdg_toplevel)
|
||||
{
|
||||
if (wl->deco)
|
||||
{
|
||||
zxdg_toplevel_decoration_v1_set_mode(wl->deco, ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
|
||||
}
|
||||
zxdg_toplevel_v6_set_title(wl->zxdg_toplevel, title);
|
||||
}
|
||||
}
|
||||
zxdg_toplevel_decoration_v1_set_mode(wl->deco,
|
||||
ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
|
||||
}
|
||||
}
|
||||
if (wl->xdg_toplevel)
|
||||
xdg_toplevel_set_title(wl->xdg_toplevel, title);
|
||||
else if (wl->zxdg_toplevel)
|
||||
zxdg_toplevel_v6_set_title(wl->zxdg_toplevel, title);
|
||||
}
|
||||
}
|
||||
|
||||
static bool gfx_ctx_wl_get_metrics(void *data,
|
||||
|
||||
@@ -85,6 +85,8 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static void gfx_ctx_wgl_destroy(void *data);
|
||||
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGL1) || defined(HAVE_OPENGL_CORE)
|
||||
typedef HGLRC (APIENTRY *wglCreateContextAttribsProc)(HDC, HGLRC, const int*);
|
||||
static wglCreateContextAttribsProc pcreate_context;
|
||||
@@ -512,28 +514,11 @@ static bool gfx_ctx_wgl_set_resize(void *data,
|
||||
|
||||
static void gfx_ctx_wgl_update_title(void *data, void *data2)
|
||||
{
|
||||
const settings_t *settings = config_get_ptr();
|
||||
video_frame_info_t* video_info = (video_frame_info_t*)data2;
|
||||
char title[128];
|
||||
|
||||
title[0] = '\0';
|
||||
|
||||
if (settings->bools.video_memory_show)
|
||||
{
|
||||
#ifndef __WINRT__
|
||||
uint64_t mem_bytes_used = frontend_driver_get_used_memory();
|
||||
uint64_t mem_bytes_total = frontend_driver_get_total_memory();
|
||||
char mem[128];
|
||||
|
||||
mem[0] = '\0';
|
||||
|
||||
snprintf(
|
||||
mem, sizeof(mem), " || MEM: %.2f/%.2fMB", mem_bytes_used / (1024.0f * 1024.0f),
|
||||
mem_bytes_total / (1024.0f * 1024.0f));
|
||||
strlcat(video_info->fps_text, mem, sizeof(video_info->fps_text));
|
||||
#endif
|
||||
}
|
||||
|
||||
video_driver_get_window_title(title, sizeof(title));
|
||||
|
||||
if (title[0])
|
||||
@@ -580,7 +565,7 @@ static void *gfx_ctx_wgl_init(video_frame_info_t *video_info, void *video_driver
|
||||
return NULL;
|
||||
|
||||
if (g_win32_inited)
|
||||
goto error;
|
||||
gfx_ctx_wgl_destroy(NULL);
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
dll_handle = dylib_load("OpenGL32.dll");
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2016-2017 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string/stdstring.h>
|
||||
#include <encodings/utf.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
#endif
|
||||
|
||||
#include "../font_driver.h"
|
||||
#include "../video_driver.h"
|
||||
#include "../../configuration.h"
|
||||
#include "../../verbosity.h"
|
||||
#include "../common/fpga_common.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const font_renderer_driver_t *fpga_font_driver;
|
||||
void *fpga_font_data;
|
||||
fpga_t *fpga;
|
||||
} fpga_raster_t;
|
||||
|
||||
static void *fpga_init_font(void *data,
|
||||
const char *font_path, float font_size,
|
||||
bool is_threaded)
|
||||
{
|
||||
fpga_raster_t *font = (fpga_raster_t*)calloc(1, sizeof(*font));
|
||||
|
||||
if (!font)
|
||||
return NULL;
|
||||
|
||||
font->fpga = (fpga_t*)data;
|
||||
|
||||
font_size = 1;
|
||||
|
||||
if (!font_renderer_create_default((const void**)&font->fpga_font_driver,
|
||||
&font->fpga_font_data, font_path, font_size))
|
||||
{
|
||||
RARCH_WARN("Couldn't initialize font renderer.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return font;
|
||||
}
|
||||
|
||||
static void fpga_render_free_font(void *data, bool is_threaded)
|
||||
{
|
||||
(void)data;
|
||||
(void)is_threaded;
|
||||
}
|
||||
|
||||
static int fpga_get_message_width(void *data, const char *msg,
|
||||
unsigned msg_len, float scale)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct font_glyph *fpga_font_get_glyph(
|
||||
void *data, uint32_t code)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void fpga_render_msg(
|
||||
video_frame_info_t *video_info,
|
||||
void *data, const char *msg,
|
||||
const void *userdata)
|
||||
{
|
||||
float x, y, scale;
|
||||
fpga_raster_t *font = (fpga_raster_t*)data;
|
||||
unsigned newX, newY, len;
|
||||
unsigned align;
|
||||
const struct font_params *params = (const struct font_params*)userdata;
|
||||
unsigned width = video_info->width;
|
||||
unsigned height = video_info->height;
|
||||
|
||||
if (!font || string_is_empty(msg))
|
||||
return;
|
||||
|
||||
if (params)
|
||||
{
|
||||
x = params->x;
|
||||
y = params->y;
|
||||
scale = params->scale;
|
||||
align = params->text_align;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = video_info->font_msg_pos_x;
|
||||
y = video_info->font_msg_pos_y;
|
||||
scale = 1.0f;
|
||||
align = TEXT_ALIGN_LEFT;
|
||||
}
|
||||
|
||||
if (!font->fpga)
|
||||
return;
|
||||
|
||||
len = utf8len(msg);
|
||||
|
||||
switch (align)
|
||||
{
|
||||
case TEXT_ALIGN_LEFT:
|
||||
newX = x * width * scale;
|
||||
break;
|
||||
case TEXT_ALIGN_RIGHT:
|
||||
newX = (x * width * scale) - len;
|
||||
break;
|
||||
case TEXT_ALIGN_CENTER:
|
||||
newX = (x * width * scale) - (len / 2);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* TODO: draw osd msg */
|
||||
}
|
||||
|
||||
static void fpga_font_flush_block(unsigned width, unsigned height, void* data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void fpga_font_bind_block(void* data, void* userdata)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
font_renderer_t fpga_font = {
|
||||
fpga_init_font,
|
||||
fpga_render_free_font,
|
||||
fpga_render_msg,
|
||||
"fpga font",
|
||||
fpga_font_get_glyph, /* get_glyph */
|
||||
fpga_font_bind_block, /* bind_block */
|
||||
fpga_font_flush_block, /* flush */
|
||||
fpga_get_message_width /* get_message_width */
|
||||
};
|
||||
@@ -80,6 +80,12 @@
|
||||
_buffer = [_context.device newBufferWithBytes:_atlas->buffer
|
||||
length:(NSUInteger)(_stride * _atlas->height)
|
||||
options:MTLResourceStorageModeManaged];
|
||||
|
||||
// Even though newBufferWithBytes will copy the initial contents
|
||||
// from our atlas, it doesn't seem to invalidate the buffer when
|
||||
// doing so, causing corrupted text rendering if we hit this code
|
||||
// path. To work around it we manually invalidate the buffer.
|
||||
[_buffer didModifyRange:NSMakeRange(0, _buffer.length)];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -324,7 +330,7 @@ static INLINE void write_quad6(SpriteVertex *pv,
|
||||
id<MTLRenderCommandEncoder> rce = _context.rce;
|
||||
[rce pushDebugGroup:@"render fonts"];
|
||||
|
||||
[_context resetRenderViewport];
|
||||
[_context resetRenderViewport:kFullscreenViewport];
|
||||
[rce setRenderPipelineState:_state];
|
||||
[rce setVertexBytes:&_uniforms length:sizeof(Uniforms) atIndex:BufferIndexUniforms];
|
||||
[rce setVertexBuffer:_vert offset:start atIndex:BufferIndexPositions];
|
||||
|
||||
@@ -45,10 +45,15 @@ static u32 gsKit_fontm_clut[16] = { 0x00000000, 0x11111111, 0x22222222, 0x333333
|
||||
|
||||
static void deinit_texture(GSTEXTURE *texture)
|
||||
{
|
||||
free(texture->Mem);
|
||||
free(texture->Clut);
|
||||
texture->Mem = NULL;
|
||||
texture->Clut = NULL;
|
||||
if (texture->Mem!= NULL) {
|
||||
free(texture->Mem);
|
||||
texture->Mem = NULL;
|
||||
}
|
||||
|
||||
if (texture->Mem!= NULL) {
|
||||
free(texture->Clut);
|
||||
texture->Clut = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void deinit_gsfont(GSFONTM *gsFontM)
|
||||
|
||||
@@ -1,684 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef _XBOX
|
||||
#include <xtl.h>
|
||||
#include <xgraphics.h>
|
||||
#endif
|
||||
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "../common/d3d_common.h"
|
||||
#include "../common/d3d9_common.h"
|
||||
#include "../font_driver.h"
|
||||
|
||||
#include "../drivers/d3d_shaders/font.hlsl.d3d9.h"
|
||||
|
||||
#define XPR0_MAGIC_VALUE 0x30525058
|
||||
#define XPR1_MAGIC_VALUE 0x31525058
|
||||
#define XPR2_MAGIC_VALUE 0x58505232
|
||||
|
||||
#define FONT_SCALE(d3d) ((d3d->resolution_hd_enable) ? 2 : 1)
|
||||
#define CALCFONTFILEHEADERSIZE(x) ( sizeof(uint32_t) + (sizeof(float)* 4) + sizeof(uint16_t) + (sizeof(wchar_t)*(x)) )
|
||||
#define FONTFILEVERSION 5
|
||||
|
||||
#ifdef _XBOX360
|
||||
struct XPR_HEADER
|
||||
{
|
||||
DWORD dwMagic;
|
||||
DWORD dwHeaderSize;
|
||||
DWORD dwDataSize;
|
||||
};
|
||||
#endif
|
||||
|
||||
/* structure member offsets matter */
|
||||
struct XBRESOURCE
|
||||
{
|
||||
DWORD dwType;
|
||||
DWORD dwOffset;
|
||||
DWORD dwSize;
|
||||
char *strName;
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
RESOURCETYPE_USERDATA = ( ( 'U' << 24 ) | ( 'S' << 16 ) | ( 'E' << 8 ) | ( 'R' ) ),
|
||||
RESOURCETYPE_TEXTURE = ( ( 'T' << 24 ) | ( 'X' << 16 ) | ( '2' << 8 ) | ( 'D' ) ),
|
||||
RESOURCETYPE_VERTEXBUFFER = ( ( 'V' << 24 ) | ( 'B' << 16 ) | ( 'U' << 8 ) | ( 'F' ) ),
|
||||
RESOURCETYPE_INDEXBUFFER = ( ( 'I' << 24 ) | ( 'B' << 16 ) | ( 'U' << 8 ) | ( 'F' ) ),
|
||||
RESOURCETYPE_EOF = 0xffffffff
|
||||
};
|
||||
|
||||
class PackedResource
|
||||
{
|
||||
protected:
|
||||
BYTE* m_pSysMemData; /* Allocated memory for resource headers etc. */
|
||||
DWORD m_dwSysMemDataSize;
|
||||
|
||||
BYTE* m_pVidMemData; /* Allocated memory for resource data, etc. */
|
||||
DWORD m_dwVidMemDataSize;
|
||||
|
||||
XBRESOURCE* m_pResourceTags; /* Tags to associate names with the resources */
|
||||
DWORD m_dwNumResourceTags; /* Number of resource tags */
|
||||
|
||||
public:
|
||||
/* Loads the resources out of the specified bundle */
|
||||
HRESULT Create(const char *strFilename, DWORD dwNumResourceTags,
|
||||
void *pResourceTags);
|
||||
|
||||
void Destroy();
|
||||
|
||||
BOOL m_bInitialized; /* Resource is fully initialized */
|
||||
|
||||
/* Functions to retrieve resources by their name */
|
||||
void *GetData( const char* strName );
|
||||
LPDIRECT3DTEXTURE9 *GetTexture(const char* strName);
|
||||
|
||||
/* Constructor/destructor */
|
||||
PackedResource();
|
||||
~PackedResource();
|
||||
};
|
||||
|
||||
LPDIRECT3DTEXTURE9 *PackedResource::GetTexture(const char* strName)
|
||||
{
|
||||
LPDIRECT3DRESOURCE9 pResource = (LPDIRECT3DRESOURCE9)GetData(strName);
|
||||
return (LPDIRECT3DTEXTURE9*)pResource;
|
||||
}
|
||||
|
||||
PackedResource::PackedResource()
|
||||
{
|
||||
m_pSysMemData = NULL;
|
||||
m_pVidMemData = NULL;
|
||||
m_pResourceTags = NULL;
|
||||
m_dwSysMemDataSize = 0L;
|
||||
m_dwVidMemDataSize = 0L;
|
||||
m_dwNumResourceTags = 0L;
|
||||
m_bInitialized = false;
|
||||
}
|
||||
|
||||
PackedResource::~PackedResource()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void *PackedResource::GetData(const char *strName)
|
||||
{
|
||||
if (!m_pResourceTags || !strName)
|
||||
return NULL;
|
||||
|
||||
for (DWORD i = 0; i < m_dwNumResourceTags; i++)
|
||||
{
|
||||
if (string_is_equal_noncase(strName, m_pResourceTags[i].strName))
|
||||
return &m_pSysMemData[m_pResourceTags[i].dwOffset];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static INLINE void* AllocateContiguousMemory(DWORD Size, DWORD Alignment)
|
||||
{
|
||||
return XMemAlloc(Size, MAKE_XALLOC_ATTRIBUTES(0, 0, 0, 0, eXALLOCAllocatorId_GameMax,
|
||||
Alignment, XALLOC_MEMPROTECT_WRITECOMBINE, 0, XALLOC_MEMTYPE_PHYSICAL));
|
||||
}
|
||||
|
||||
static INLINE void FreeContiguousMemory(void* pData)
|
||||
{
|
||||
return XMemFree(pData, MAKE_XALLOC_ATTRIBUTES(0, 0, 0, 0, eXALLOCAllocatorId_GameMax,
|
||||
0, 0, 0, XALLOC_MEMTYPE_PHYSICAL));
|
||||
}
|
||||
|
||||
HRESULT PackedResource::Create(const char *strFilename,
|
||||
DWORD dwNumResourceTags, void* pResourceTags)
|
||||
{
|
||||
unsigned i;
|
||||
DWORD dwNumBytesRead;
|
||||
XPR_HEADER xprh;
|
||||
HANDLE hFile = CreateFile(strFilename, GENERIC_READ, FILE_SHARE_READ, NULL,
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL);
|
||||
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
return E_FAIL;
|
||||
|
||||
if (!ReadFile(hFile, &xprh, sizeof(XPR_HEADER), &dwNumBytesRead, NULL) ||
|
||||
xprh.dwMagic != XPR2_MAGIC_VALUE)
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* Compute memory requirements */
|
||||
m_dwSysMemDataSize = xprh.dwHeaderSize;
|
||||
m_dwVidMemDataSize = xprh.dwDataSize;
|
||||
|
||||
/* Allocate memory */
|
||||
m_pSysMemData = (BYTE*)malloc(m_dwSysMemDataSize);
|
||||
|
||||
if (!m_pSysMemData)
|
||||
{
|
||||
m_dwSysMemDataSize = 0;
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_pVidMemData = (BYTE*)AllocateContiguousMemory(m_dwVidMemDataSize,
|
||||
XALLOC_PHYSICAL_ALIGNMENT_4K
|
||||
);
|
||||
|
||||
if(!m_pVidMemData)
|
||||
{
|
||||
m_dwSysMemDataSize = 0;
|
||||
m_dwVidMemDataSize = 0;
|
||||
free(m_pSysMemData);
|
||||
m_pSysMemData = NULL;
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* Read in the data from the file */
|
||||
if( !ReadFile( hFile, m_pSysMemData, m_dwSysMemDataSize, &dwNumBytesRead, NULL) ||
|
||||
!ReadFile( hFile, m_pVidMemData, m_dwVidMemDataSize, &dwNumBytesRead, NULL))
|
||||
{
|
||||
CloseHandle( hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* Done with the file */
|
||||
CloseHandle( hFile);
|
||||
|
||||
/* Extract resource table from the header data */
|
||||
m_dwNumResourceTags = *(DWORD*)(m_pSysMemData + 0);
|
||||
m_pResourceTags = (XBRESOURCE*)(m_pSysMemData + 4);
|
||||
|
||||
/* Patch up the resources */
|
||||
|
||||
for(i = 0; i < m_dwNumResourceTags; i++)
|
||||
{
|
||||
m_pResourceTags[i].strName = (char*)(m_pSysMemData + (DWORD)m_pResourceTags[i].strName);
|
||||
if((m_pResourceTags[i].dwType & 0xffff0000) == (RESOURCETYPE_TEXTURE & 0xffff0000))
|
||||
{
|
||||
D3DTexture *pTexture = (D3DTexture*)&m_pSysMemData[m_pResourceTags[i].dwOffset];
|
||||
XGOffsetBaseTextureAddress(pTexture, m_pVidMemData, m_pVidMemData);
|
||||
}
|
||||
}
|
||||
|
||||
m_bInitialized = true;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void PackedResource::Destroy()
|
||||
{
|
||||
free(m_pSysMemData);
|
||||
|
||||
if (m_pVidMemData != NULL)
|
||||
FreeContiguousMemory(m_pVidMemData);
|
||||
|
||||
m_pSysMemData = NULL;
|
||||
m_pVidMemData = NULL;
|
||||
m_pResourceTags = NULL;
|
||||
m_dwSysMemDataSize = 0L;
|
||||
m_dwVidMemDataSize = 0L;
|
||||
m_dwNumResourceTags = 0L;
|
||||
|
||||
m_bInitialized = false;
|
||||
}
|
||||
|
||||
typedef struct GLYPH_ATTR
|
||||
{
|
||||
uint16_t tu1, tv1, tu2, tv2; /* Texture coordinates for the image. */
|
||||
int16_t wOffset; /* Pixel offset for glyph start. */
|
||||
int16_t wWidth; /* Pixel width of the glyph. */
|
||||
int16_t wAdvance; /* Pixels to advance after the glyph. */
|
||||
uint16_t wMask;
|
||||
} GLYPH_ATTR;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
D3DVertexDeclaration *m_pFontVertexDecl;
|
||||
D3DVertexShader *m_pFontVertexShader;
|
||||
D3DPixelShader *m_pFontPixelShader;
|
||||
} Font_Locals_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Font_Locals_t s_FontLocals;
|
||||
d3d9_video_t *d3d;
|
||||
uint32_t m_dwSavedState;
|
||||
uint32_t m_cMaxGlyph; /* Number of entries in the translator table. */
|
||||
uint32_t m_dwNumGlyphs; /* Number of valid glyphs. */
|
||||
float m_fFontHeight; /* Height of the font strike in pixels. */
|
||||
float m_fFontTopPadding; /* Padding above the strike zone. */
|
||||
float m_fFontBottomPadding; /* Padding below the strike zone. */
|
||||
float m_fFontYAdvance; /* Number of pixels to move the cursor for a line feed. */
|
||||
wchar_t * m_TranslatorTable; /* ASCII to glyph lookup table. */
|
||||
LPDIRECT3DTEXTURE9 m_pFontTexture;
|
||||
const GLYPH_ATTR* m_Glyphs; /* Array of glyphs. */
|
||||
} xdk360_video_font_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t m_dwFileVersion; /* Version of the font file (Must match FONTFILEVERSION). */
|
||||
float m_fFontHeight; /* Height of the font strike in pixels. */
|
||||
float m_fFontTopPadding; /* Padding above the strike zone. */
|
||||
float m_fFontBottomPadding; /* Padding below the strike zone. */
|
||||
float m_fFontYAdvance; /* Number of pixels to move the cursor for a line feed. */
|
||||
uint16_t m_cMaxGlyph; /* Number of font characters (Should be an odd number to maintain DWORD Alignment). */
|
||||
wchar_t m_TranslatorTable[1]; /* ASCII to Glyph lookup table, NOTE: It's m_cMaxGlyph+1 in size. */
|
||||
} FontFileHeaderImage_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t m_dwNumGlyphs; /* Size of font strike array (First entry is the unknown glyph). */
|
||||
GLYPH_ATTR m_Glyphs[1]; /* Array of font strike uv's etc... NOTE: It's m_dwNumGlyphs in size. */
|
||||
} FontFileStrikesImage_t;
|
||||
|
||||
static PackedResource m_xprResource;
|
||||
|
||||
static bool xdk360_video_font_create_shaders(xdk360_video_font_t * font, LPDIRECT3DDEVICE9 dev)
|
||||
{
|
||||
ID3DXBuffer* pShaderCode = NULL;
|
||||
|
||||
static const D3DVERTEXELEMENT9 decl[] =
|
||||
{
|
||||
{ 0, 0, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 },
|
||||
{ 0, 8, D3DDECLTYPE_USHORT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 },
|
||||
{ 0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1 },
|
||||
D3DDECL_END()
|
||||
};
|
||||
|
||||
if (font->s_FontLocals.m_pFontVertexDecl)
|
||||
{
|
||||
font->s_FontLocals.m_pFontVertexDecl->AddRef();
|
||||
font->s_FontLocals.m_pFontVertexShader->AddRef();
|
||||
font->s_FontLocals.m_pFontPixelShader->AddRef();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!d3d9_vertex_declaration_new(dev, decl, (void**)&font->s_FontLocals.m_pFontVertexDecl))
|
||||
goto error;
|
||||
|
||||
if (!d3d9x_compile_shader( font_hlsl_d3d9_program, sizeof(font_hlsl_d3d9_program)-1 ,
|
||||
NULL, NULL, "main_vertex", "vs.2.0", 0, &pShaderCode, NULL, NULL ))
|
||||
goto error;
|
||||
|
||||
if (!d3d9_create_vertex_shader(dev, (const DWORD*)pShaderCode->GetBufferPointer(),
|
||||
(void**)&font->s_FontLocals.m_pFontVertexShader ))
|
||||
goto error;
|
||||
|
||||
d3d9x_buffer_release(pShaderCode);
|
||||
|
||||
if (!d3d9x_compile_shader(font_hlsl_d3d9_program, sizeof(font_hlsl_d3d9_program)-1 ,
|
||||
NULL, NULL, "main_fragment", "ps.2.0", 0,&pShaderCode, NULL, NULL ))
|
||||
goto error;
|
||||
|
||||
if (!d3d9_create_pixel_shader(dev, (DWORD*)pShaderCode->GetBufferPointer(),
|
||||
(void**)&font->s_FontLocals.m_pFontPixelShader))
|
||||
goto error;
|
||||
|
||||
d3d9x_buffer_release(pShaderCode);
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
if (pShaderCode)
|
||||
d3d9x_buffer_release(pShaderCode);
|
||||
d3d9_free_pixel_shader((LPDIRECT3DDEVICE9)font->d3d->dev, font->s_FontLocals.m_pFontPixelShader);
|
||||
d3d9_free_vertex_shader((LPDIRECT3DDEVICE9)font->d3d->dev, font->s_FontLocals.m_pFontVertexShader);
|
||||
d3d9_vertex_declaration_free(font->s_FontLocals.m_pFontVertexDecl);
|
||||
font->s_FontLocals.m_pFontPixelShader = NULL;
|
||||
font->s_FontLocals.m_pFontVertexShader = NULL;
|
||||
font->s_FontLocals.m_pFontVertexDecl = NULL;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void *xdk360_init_font(void *video_data,
|
||||
const char *font_path, float font_size,
|
||||
bool is_threaded)
|
||||
{
|
||||
uint32_t dwFileVersion;
|
||||
const void *pFontData = NULL;
|
||||
void *pFontTexture = NULL;
|
||||
const uint8_t * pData = NULL;
|
||||
xdk360_video_font_t *font = (xdk360_video_font_t*)calloc(1, sizeof(*font));
|
||||
|
||||
if (!font)
|
||||
return NULL;
|
||||
|
||||
(void)font_size;
|
||||
|
||||
font->d3d = (d3d9_video_t*)video_data;
|
||||
|
||||
font->m_pFontTexture = NULL;
|
||||
font->m_dwNumGlyphs = 0L;
|
||||
font->m_Glyphs = NULL;
|
||||
font->m_cMaxGlyph = 0;
|
||||
font->m_TranslatorTable = NULL;
|
||||
|
||||
/* Create the font. */
|
||||
if (FAILED( m_xprResource.Create(font_path, 0, NULL)))
|
||||
goto error;
|
||||
|
||||
pFontTexture = (LPDIRECT3DTEXTURE9)m_xprResource.GetTexture( "FontTexture" );
|
||||
pFontData = m_xprResource.GetData( "FontData");
|
||||
|
||||
/* Save a copy of the texture. */
|
||||
font->m_pFontTexture = (LPDIRECT3DTEXTURE9)pFontTexture;
|
||||
|
||||
/* Check version of file (to make sure it matches up with the FontMaker tool). */
|
||||
pData = (const uint8_t*)pFontData;
|
||||
dwFileVersion = ((const FontFileHeaderImage_t *)pData)->m_dwFileVersion;
|
||||
|
||||
if (dwFileVersion != FONTFILEVERSION)
|
||||
{
|
||||
RARCH_ERR("Incorrect version number on font file.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
font->m_fFontHeight = ((const FontFileHeaderImage_t *)pData)->m_fFontHeight;
|
||||
font->m_fFontTopPadding = ((const FontFileHeaderImage_t *)pData)->m_fFontTopPadding;
|
||||
font->m_fFontBottomPadding = ((const FontFileHeaderImage_t *)pData)->m_fFontBottomPadding;
|
||||
font->m_fFontYAdvance = ((const FontFileHeaderImage_t *)pData)->m_fFontYAdvance;
|
||||
|
||||
/* Point to the translator string which immediately follows the 4 floats. */
|
||||
font->m_cMaxGlyph = ((const FontFileHeaderImage_t *)pData)->m_cMaxGlyph;
|
||||
font->m_TranslatorTable = const_cast<FontFileHeaderImage_t*>((const FontFileHeaderImage_t *)pData)->m_TranslatorTable;
|
||||
|
||||
pData += CALCFONTFILEHEADERSIZE(font->m_cMaxGlyph + 1);
|
||||
|
||||
/* Read the glyph attributes from the file. */
|
||||
font->m_dwNumGlyphs = ((const FontFileStrikesImage_t *)pData)->m_dwNumGlyphs;
|
||||
font->m_Glyphs = ((const FontFileStrikesImage_t *)pData)->m_Glyphs;
|
||||
|
||||
/* Create the vertex and pixel shaders for rendering the font */
|
||||
if (!xdk360_video_font_create_shaders(font, (LPDIRECT3DDEVICE9)font->d3d->dev))
|
||||
{
|
||||
RARCH_ERR( "Could not create font shaders.\n" );
|
||||
goto error;
|
||||
}
|
||||
|
||||
RARCH_LOG("Successfully initialized D3D9 HLSL fonts.\n");
|
||||
return font;
|
||||
error:
|
||||
RARCH_ERR("Could not initialize D3D9 HLSL fonts.\n");
|
||||
if (font)
|
||||
free(font);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void xdk360_free_font(void *data, bool is_threaded)
|
||||
{
|
||||
xdk360_video_font_t *font = (xdk360_video_font_t*)data;
|
||||
|
||||
if (!font)
|
||||
return;
|
||||
|
||||
/* Destroy the font */
|
||||
font->m_pFontTexture = NULL;
|
||||
font->m_dwNumGlyphs = 0L;
|
||||
font->m_Glyphs = NULL;
|
||||
font->m_cMaxGlyph = 0;
|
||||
font->m_TranslatorTable = NULL;
|
||||
|
||||
d3d9_free_pixel_shader((LPDIRECT3DDEVICE9)font->d3d->dev, font->s_FontLocals.m_pFontPixelShader);
|
||||
d3d9_free_vertex_shader((LPDIRECT3DDEVICE9)font->d3d->dev, font->s_FontLocals.m_pFontVertexShader);
|
||||
d3d9_vertex_declaration_free(font->s_FontLocals.m_pFontVertexDecl);
|
||||
|
||||
font->s_FontLocals.m_pFontPixelShader = NULL;
|
||||
font->s_FontLocals.m_pFontVertexShader = NULL;
|
||||
font->s_FontLocals.m_pFontVertexDecl = NULL;
|
||||
|
||||
if (m_xprResource.m_bInitialized)
|
||||
m_xprResource.Destroy();
|
||||
|
||||
free(font);
|
||||
font = NULL;
|
||||
}
|
||||
|
||||
static void xdk360_render_msg_post(xdk360_video_font_t * font)
|
||||
{
|
||||
LPDIRECT3DDEVICE9 dev;
|
||||
if (!font || !font->d3d)
|
||||
return;
|
||||
dev = (LPDIRECT3DDEVICE9)font->d3d->dev;
|
||||
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
d3d9_set_texture(dev, 0, NULL);
|
||||
d3d9_set_vertex_declaration(dev, NULL);
|
||||
d3d9_set_vertex_shader(dev, NULL);
|
||||
d3d9_set_pixel_shader(dev, NULL);
|
||||
d3d9_set_render_state(dev, D3DRS_VIEWPORTENABLE, font->m_dwSavedState);
|
||||
}
|
||||
|
||||
static void xdk360_render_msg_pre(xdk360_video_font_t * font)
|
||||
{
|
||||
float vTexScale[4];
|
||||
D3DSURFACE_DESC TextureDesc;
|
||||
LPDIRECT3DDEVICE9 dev;
|
||||
|
||||
if (!font || !font->d3d)
|
||||
return;
|
||||
|
||||
dev = (LPDIRECT3DDEVICE9)font->d3d->dev;
|
||||
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
/* Save state. */
|
||||
d3d9_get_render_state(font->d3d->dev, D3DRS_VIEWPORTENABLE,
|
||||
(DWORD*)&font->m_dwSavedState );
|
||||
|
||||
/* Set the texture scaling factor as a vertex shader constant. */
|
||||
/* Get the description */
|
||||
d3d9_texture_get_level_desc(font->m_pFontTexture, 0, &TextureDesc);
|
||||
|
||||
/* Set render state. */
|
||||
d3d9_set_texture(dev, 0, font->m_pFontTexture);
|
||||
|
||||
vTexScale[0] = 1.0f / TextureDesc.Width;
|
||||
vTexScale[1] = 1.0f / TextureDesc.Height;
|
||||
vTexScale[2] = 0.0f;
|
||||
vTexScale[3] = 0.0f;
|
||||
|
||||
d3d9_set_render_state(dev, D3DRS_VIEWPORTENABLE, FALSE);
|
||||
d3d9_set_vertex_declaration(dev, font->s_FontLocals.m_pFontVertexDecl);
|
||||
d3d9_set_vertex_shader(dev, font->s_FontLocals.m_pFontVertexShader);
|
||||
d3d9_set_pixel_shader(dev, font->s_FontLocals.m_pFontPixelShader);
|
||||
d3d9_set_vertex_shader_constantf(dev, 2, vTexScale, 1);
|
||||
}
|
||||
|
||||
static void xdk360_draw_text(xdk360_video_font_t *font,
|
||||
float x, float y, const wchar_t * strText)
|
||||
{
|
||||
uint32_t dwNumChars;
|
||||
float vColor[4], m_fCursorX, m_fCursorY;
|
||||
volatile float *pVertex = NULL;
|
||||
LPDIRECT3DDEVICE9 dev = (LPDIRECT3DDEVICE9)font->d3d->dev;
|
||||
|
||||
/* Set the color as a vertex shader constant. */
|
||||
vColor[0] = ((0xffffffff & 0x00ff0000) >> 16L) / 255.0f;
|
||||
vColor[1] = ((0xffffffff & 0x0000ff00) >> 8L) / 255.0f;
|
||||
vColor[2] = ((0xffffffff & 0x000000ff) >> 0L) / 255.0f;
|
||||
vColor[3] = ((0xffffffff & 0xff000000) >> 24L) / 255.0f;
|
||||
|
||||
d3d9_set_vertex_shader_constantf(dev, 1, vColor, 1);
|
||||
|
||||
m_fCursorX = floorf(x);
|
||||
m_fCursorY = floorf(y);
|
||||
|
||||
/* Adjust for padding. */
|
||||
y -= font->m_fFontTopPadding;
|
||||
|
||||
/* Begin drawing the vertices
|
||||
* Declared as volatile to force writing in ascending
|
||||
* address order.
|
||||
*
|
||||
* It prevents out of sequence writing in write combined
|
||||
* memory.
|
||||
*/
|
||||
|
||||
dwNumChars = wcslen(strText);
|
||||
#ifdef __cplusplus
|
||||
dev->BeginVertices(D3DPT_QUADLIST, 4 * dwNumChars,
|
||||
sizeof(XMFLOAT4), (void**)&pVertex);
|
||||
#else
|
||||
D3DDevice_BeginVertices(dev, D3DPT_QUADLIST, 4 * dwNumChars,
|
||||
sizeof(XMFLOAT4), (void**)&pVertex);
|
||||
#endif
|
||||
|
||||
/* Draw four vertices for each glyph. */
|
||||
while (*strText)
|
||||
{
|
||||
float fOffset, fAdvance, fWidth, fHeight;
|
||||
#ifdef MSB_FIRST
|
||||
uint32_t tu1, tu2, tv1, tv2;
|
||||
#endif
|
||||
const GLYPH_ATTR *pGlyph;
|
||||
wchar_t letter = *strText++; /* Get the current letter in the string */
|
||||
|
||||
/* Handle the newline character. */
|
||||
if (letter == L'\n')
|
||||
{
|
||||
m_fCursorX = x;
|
||||
m_fCursorY += font->m_fFontYAdvance * FONT_SCALE(font->d3d);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Translate unprintable characters. */
|
||||
if (letter <= font->m_cMaxGlyph)
|
||||
pGlyph = &font->m_Glyphs[font->m_TranslatorTable[letter]];
|
||||
else
|
||||
pGlyph = &font->m_Glyphs[0];
|
||||
|
||||
fOffset = FONT_SCALE(font->d3d) * (float)pGlyph->wOffset;
|
||||
fAdvance = FONT_SCALE(font->d3d) * (float)pGlyph->wAdvance;
|
||||
fWidth = FONT_SCALE(font->d3d) * (float)pGlyph->wWidth;
|
||||
fHeight = FONT_SCALE(font->d3d) * font->m_fFontHeight;
|
||||
|
||||
m_fCursorX += fOffset;
|
||||
|
||||
/* Add the vertices to draw this glyph. */
|
||||
|
||||
#ifdef MSB_FIRST
|
||||
/* Convert shorts to 32 bit longs for in register merging */
|
||||
tu1 = pGlyph->tu1;
|
||||
tv1 = pGlyph->tv1;
|
||||
tu2 = pGlyph->tu2;
|
||||
tv2 = pGlyph->tv2;
|
||||
#endif
|
||||
|
||||
/* NOTE: The vertexes are 2 floats for the screen coordinates,
|
||||
* followed by two USHORTS for the u/vs of the character,
|
||||
* terminated with the ARGB 32 bit color.
|
||||
*
|
||||
* This makes for 16 bytes per vertex data (Easier to read)
|
||||
*
|
||||
* Second NOTE: The U/V coordinates are merged and written
|
||||
* using a DWORD due to the write combining hardware
|
||||
* being only able to handle 32, 64 and 128 writes.
|
||||
*
|
||||
* Never store to write combined memory with 8 or 16bit
|
||||
* instructions. You've been warned.
|
||||
*/
|
||||
|
||||
/* Setup the vertex/screen coordinates */
|
||||
pVertex[0] = m_fCursorX;
|
||||
pVertex[1] = m_fCursorY;
|
||||
pVertex[3] = 0;
|
||||
pVertex[4] = m_fCursorX + fWidth;
|
||||
pVertex[5] = m_fCursorY;
|
||||
pVertex[7] = 0;
|
||||
pVertex[8] = m_fCursorX + fWidth;
|
||||
pVertex[9] = m_fCursorY + fHeight;
|
||||
pVertex[11] = 0;
|
||||
pVertex[12] = m_fCursorX;
|
||||
pVertex[13] = m_fCursorY + fHeight;
|
||||
#ifdef MSB_FIRST
|
||||
((volatile uint32_t *)pVertex)[2] = (tu1 << 16) | tv1; /* Merged using big endian rules */
|
||||
((volatile uint32_t *)pVertex)[6] = (tu2 << 16) | tv1; /* Merged using big endian rules */
|
||||
((volatile uint32_t*)pVertex)[10] = (tu2 << 16) | tv2; /* Merged using big endian rules */
|
||||
((volatile uint32_t*)pVertex)[14] = (tu1 << 16) | tv2; /* Merged using big endian rules */
|
||||
#endif
|
||||
pVertex[15] = 0;
|
||||
pVertex += 16;
|
||||
|
||||
m_fCursorX += fAdvance;
|
||||
|
||||
dwNumChars--;
|
||||
}
|
||||
|
||||
/* Since we allocated vertex data space
|
||||
* based on the string length, we now need to
|
||||
* add some dummy verts for any skipped
|
||||
* characters (like newlines, etc.)
|
||||
*/
|
||||
while (dwNumChars)
|
||||
{
|
||||
unsigned i;
|
||||
for (i = 0; i < 16; i++)
|
||||
pVertex[i] = 0;
|
||||
|
||||
pVertex += 16;
|
||||
dwNumChars--;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
dev->EndVertices();
|
||||
#else
|
||||
D3DDevice_EndVertices(dev);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void xdk360_render_msg(
|
||||
video_frame_info_t *video_info,
|
||||
void *data, const char *str_msg,
|
||||
const struct font_params *params)
|
||||
{
|
||||
float x, y;
|
||||
wchar_t msg[PATH_MAX_LENGTH];
|
||||
xdk360_video_font_t *font = (xdk360_video_font_t*)data;
|
||||
|
||||
if (params)
|
||||
{
|
||||
x = params->x;
|
||||
y = params->y;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = font->d3d->resolution_hd_enable ? 160 : 100;
|
||||
y = 120;
|
||||
}
|
||||
|
||||
mbstowcs(msg, str_msg, sizeof(msg) / sizeof(wchar_t));
|
||||
|
||||
if (msg || msg[0] != L'\0')
|
||||
{
|
||||
xdk360_render_msg_pre(font);
|
||||
xdk360_draw_text(font, x, y, msg);
|
||||
xdk360_render_msg_post(font);
|
||||
}
|
||||
}
|
||||
|
||||
font_renderer_t d3d_xbox360_font = {
|
||||
xdk360_init_font,
|
||||
xdk360_free_font,
|
||||
xdk360_render_msg,
|
||||
"xdk360_fonts",
|
||||
NULL, /* get_glyph */
|
||||
NULL, /* bind_block */
|
||||
NULL, /* flush */
|
||||
NULL /* get_message_width */
|
||||
};
|
||||
@@ -167,14 +167,17 @@ static GLint gl_glsl_get_uniform(glsl_shader_data_t *glsl,
|
||||
|
||||
buf[0] = '\0';
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s%s", glsl->shader->prefix, base);
|
||||
strlcpy(buf, glsl->shader->prefix, sizeof(buf));
|
||||
strlcat(buf, base, sizeof(buf));
|
||||
loc = glGetUniformLocation(prog, buf);
|
||||
if (loc >= 0)
|
||||
return loc;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(glsl_prefixes); i++)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s%s", glsl_prefixes[i], base);
|
||||
buf[0] = '\0';
|
||||
strlcpy(buf, glsl_prefixes[i], sizeof(buf));
|
||||
strlcat(buf, base, sizeof(buf));
|
||||
loc = glGetUniformLocation(prog, buf);
|
||||
if (loc >= 0)
|
||||
return loc;
|
||||
@@ -192,14 +195,16 @@ static GLint gl_glsl_get_attrib(glsl_shader_data_t *glsl,
|
||||
|
||||
buf[0] = '\0';
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s%s", glsl->shader->prefix, base);
|
||||
strlcpy(buf, glsl->shader->prefix, sizeof(buf));
|
||||
strlcat(buf, base, sizeof(buf));
|
||||
loc = glGetUniformLocation(prog, buf);
|
||||
if (loc >= 0)
|
||||
return loc;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(glsl_prefixes); i++)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s%s", glsl_prefixes[i], base);
|
||||
strlcpy(buf, glsl_prefixes[i], sizeof(buf));
|
||||
strlcat(buf, base, sizeof(buf));
|
||||
loc = glGetAttribLocation(prog, buf);
|
||||
if (loc >= 0)
|
||||
return loc;
|
||||
@@ -569,10 +574,14 @@ static void gl_glsl_find_uniforms_frame(glsl_shader_data_t *glsl,
|
||||
|
||||
texture[0] = texture_size[0] = input_size[0] = tex_coord[0] = '\0';
|
||||
|
||||
snprintf(texture, sizeof(texture), "%s%s", base, "Texture");
|
||||
snprintf(texture_size, sizeof(texture_size), "%s%s", base, "TextureSize");
|
||||
snprintf(input_size, sizeof(input_size), "%s%s", base, "InputSize");
|
||||
snprintf(tex_coord, sizeof(tex_coord), "%s%s", base, "TexCoord");
|
||||
strlcpy(texture, base, sizeof(texture));
|
||||
strlcat(texture, "Texture", sizeof(texture));
|
||||
strlcpy(texture_size, base, sizeof(texture_size));
|
||||
strlcat(texture_size, "TextureSize", sizeof(texture_size));
|
||||
strlcpy(input_size, base, sizeof(input_size));
|
||||
strlcat(input_size, "InputSize", sizeof(input_size));
|
||||
strlcpy(tex_coord, base, sizeof(tex_coord));
|
||||
strlcat(tex_coord, "TexCoord", sizeof(tex_coord));
|
||||
|
||||
if (frame->texture < 0)
|
||||
frame->texture = gl_glsl_get_uniform(glsl, prog, texture);
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <stdio.h>
|
||||
#include <compat/strl.h>
|
||||
#include "../../verbosity.h"
|
||||
|
||||
using namespace std;
|
||||
@@ -723,8 +724,13 @@ bool slang_reflect(
|
||||
}
|
||||
}
|
||||
|
||||
RARCH_LOG("[slang]:\n");
|
||||
RARCH_LOG("[slang]: Parameters:\n");
|
||||
{
|
||||
char buf[64];
|
||||
buf[0] = '\0';
|
||||
snprintf(buf, sizeof(buf),
|
||||
"[slang]:\n%s [slang]: Parameters:\n", FILE_PATH_LOG_INFO);
|
||||
RARCH_LOG(buf);
|
||||
}
|
||||
|
||||
for (i = 0; i < reflection->semantic_float_parameters.size(); i++)
|
||||
{
|
||||
|
||||
+1
-3
@@ -119,9 +119,7 @@ static bool d3d8_font_init_first(
|
||||
|
||||
#ifdef HAVE_D3D9
|
||||
static const font_renderer_t *d3d9_font_backends[] = {
|
||||
#if defined(_XBOX)
|
||||
&d3d_xbox360_font,
|
||||
#elif defined(_WIN32) && defined(HAVE_D3DX)
|
||||
#if defined(_WIN32) && defined(HAVE_D3DX)
|
||||
&d3d_win32_font,
|
||||
#endif
|
||||
NULL
|
||||
|
||||
+1
-1
@@ -162,7 +162,6 @@ int font_driver_get_line_height(void *font_data, float scale);
|
||||
extern font_renderer_t gl_raster_font;
|
||||
extern font_renderer_t gl_core_raster_font;
|
||||
extern font_renderer_t gl1_raster_font;
|
||||
extern font_renderer_t d3d_xbox360_font;
|
||||
extern font_renderer_t d3d_xdk1_font;
|
||||
extern font_renderer_t d3d_win32_font;
|
||||
extern font_renderer_t ps2_font;
|
||||
@@ -177,6 +176,7 @@ extern font_renderer_t d3d12_font;
|
||||
extern font_renderer_t caca_font;
|
||||
extern font_renderer_t gdi_font;
|
||||
extern font_renderer_t vga_font;
|
||||
extern font_renderer_t fpga_font;
|
||||
extern font_renderer_t sixel_font;
|
||||
extern font_renderer_t switch_font;
|
||||
|
||||
|
||||
@@ -38,8 +38,6 @@ static unsigned ra_core_height = 0;
|
||||
static unsigned ra_tmp_width = 0;
|
||||
static unsigned ra_tmp_height = 0;
|
||||
static unsigned ra_set_core_hz = 0;
|
||||
static unsigned orig_width = 0;
|
||||
static unsigned orig_height = 0;
|
||||
static int crt_center_adjust = 0;
|
||||
static int crt_tmp_center_adjust = 0;
|
||||
static double p_clock = 0;
|
||||
|
||||
@@ -76,6 +76,7 @@ enum rarch_display_type
|
||||
RARCH_DISPLAY_X11,
|
||||
/* video_display => N/A, video_window => HWND */
|
||||
RARCH_DISPLAY_WIN32,
|
||||
RARCH_DISPLAY_WAYLAND,
|
||||
RARCH_DISPLAY_OSX
|
||||
};
|
||||
|
||||
@@ -98,8 +99,10 @@ enum font_driver_render_api
|
||||
FONT_DRIVER_RENDER_METAL_API,
|
||||
FONT_DRIVER_RENDER_CACA,
|
||||
FONT_DRIVER_RENDER_SIXEL,
|
||||
FONT_DRIVER_RENDER_NETWORK_VIDEO,
|
||||
FONT_DRIVER_RENDER_GDI,
|
||||
FONT_DRIVER_RENDER_VGA,
|
||||
FONT_DRIVER_RENDER_FPGA,
|
||||
FONT_DRIVER_RENDER_SWITCH
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -2,12 +2,12 @@
|
||||
#include <file/file_path.h>
|
||||
#include <file/archive_file.h>
|
||||
#include <compat/strl.h>
|
||||
#include <verbosity.h>
|
||||
|
||||
#include "video_layout.h"
|
||||
#include "video_layout/view.h"
|
||||
|
||||
#include "../retroarch.h"
|
||||
#include "../verbosity.h"
|
||||
|
||||
bool load(view_array_t *view_array, rxml_document_t *doc);
|
||||
|
||||
|
||||
+127
-127
@@ -13,51 +13,51 @@ void component_init(component_t *comp, comp_type_t type)
|
||||
|
||||
switch (comp->type)
|
||||
{
|
||||
case VIDEO_LAYOUT_C_UNKNOWN:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_SCREEN:
|
||||
comp->attr.screen.index = 0;
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_RECT:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DISK:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_IMAGE:
|
||||
comp->attr.image.file = NULL;
|
||||
comp->attr.image.alpha_file = NULL;
|
||||
comp->attr.image.image_idx = 0;
|
||||
comp->attr.image.alpha_idx = 0;
|
||||
comp->attr.image.loaded = false;
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_TEXT:
|
||||
comp->attr.text.string = NULL;
|
||||
comp->attr.text.align = VIDEO_LAYOUT_TEXT_ALIGN_CENTER;
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_COUNTER:
|
||||
comp->attr.counter.digits = 2;
|
||||
comp->attr.counter.max_state = 999;
|
||||
comp->attr.counter.align = VIDEO_LAYOUT_TEXT_ALIGN_CENTER;
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_X1:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_H5:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_H8:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_7:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_8_GTS1:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_14:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_14_SC:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_16:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_16_SC:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_REEL:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_UNKNOWN:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_SCREEN:
|
||||
comp->attr.screen.index = 0;
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_RECT:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DISK:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_IMAGE:
|
||||
comp->attr.image.file = NULL;
|
||||
comp->attr.image.alpha_file = NULL;
|
||||
comp->attr.image.image_idx = 0;
|
||||
comp->attr.image.alpha_idx = 0;
|
||||
comp->attr.image.loaded = false;
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_TEXT:
|
||||
comp->attr.text.string = NULL;
|
||||
comp->attr.text.align = VIDEO_LAYOUT_TEXT_ALIGN_CENTER;
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_COUNTER:
|
||||
comp->attr.counter.digits = 2;
|
||||
comp->attr.counter.max_state = 999;
|
||||
comp->attr.counter.align = VIDEO_LAYOUT_TEXT_ALIGN_CENTER;
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_X1:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_H5:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_H8:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_7:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_8_GTS1:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_14:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_14_SC:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_16:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_16_SC:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_REEL:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,51 +72,51 @@ void component_copy(component_t *comp, const component_t *src)
|
||||
|
||||
switch (comp->type)
|
||||
{
|
||||
case VIDEO_LAYOUT_C_UNKNOWN:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_SCREEN:
|
||||
comp->attr.screen.index = src->attr.screen.index;
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_RECT:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DISK:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_IMAGE:
|
||||
comp->attr.image.file = init_string(src->attr.image.file);
|
||||
comp->attr.image.alpha_file = init_string(src->attr.image.alpha_file);
|
||||
comp->attr.image.image_idx = src->attr.image.image_idx;
|
||||
comp->attr.image.alpha_idx = src->attr.image.alpha_idx;
|
||||
comp->attr.image.loaded = src->attr.image.loaded;
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_TEXT:
|
||||
comp->attr.text.string = init_string(src->attr.text.string);
|
||||
comp->attr.text.align = src->attr.text.align;
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_COUNTER:
|
||||
comp->attr.counter.digits = src->attr.counter.digits;
|
||||
comp->attr.counter.max_state = src->attr.counter.max_state;
|
||||
comp->attr.counter.align = src->attr.counter.align;
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_X1:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_H5:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_H8:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_7:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_8_GTS1:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_14:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_14_SC:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_16:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_16_SC:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_REEL:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_UNKNOWN:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_SCREEN:
|
||||
comp->attr.screen.index = src->attr.screen.index;
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_RECT:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DISK:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_IMAGE:
|
||||
comp->attr.image.file = init_string(src->attr.image.file);
|
||||
comp->attr.image.alpha_file = init_string(src->attr.image.alpha_file);
|
||||
comp->attr.image.image_idx = src->attr.image.image_idx;
|
||||
comp->attr.image.alpha_idx = src->attr.image.alpha_idx;
|
||||
comp->attr.image.loaded = src->attr.image.loaded;
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_TEXT:
|
||||
comp->attr.text.string = init_string(src->attr.text.string);
|
||||
comp->attr.text.align = src->attr.text.align;
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_COUNTER:
|
||||
comp->attr.counter.digits = src->attr.counter.digits;
|
||||
comp->attr.counter.max_state = src->attr.counter.max_state;
|
||||
comp->attr.counter.align = src->attr.counter.align;
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_X1:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_H5:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_H8:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_7:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_8_GTS1:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_14:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_14_SC:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_16:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_16_SC:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_REEL:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,42 +124,42 @@ void component_deinit(component_t *comp)
|
||||
{
|
||||
switch (comp->type)
|
||||
{
|
||||
case VIDEO_LAYOUT_C_UNKNOWN:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_SCREEN:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_RECT:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DISK:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_IMAGE:
|
||||
free(comp->attr.image.file);
|
||||
free(comp->attr.image.alpha_file);
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_TEXT:
|
||||
free(comp->attr.text.string);
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_COUNTER:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_X1:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_H5:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_H8:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_7:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_8_GTS1:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_14:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_14_SC:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_16:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_16_SC:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_REEL:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_UNKNOWN:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_SCREEN:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_RECT:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DISK:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_IMAGE:
|
||||
free(comp->attr.image.file);
|
||||
free(comp->attr.image.alpha_file);
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_TEXT:
|
||||
free(comp->attr.text.string);
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_COUNTER:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_X1:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_H5:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_H8:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_7:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_8_GTS1:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_14:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_14_SC:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_16:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_16_SC:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_REEL:
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -23,8 +23,7 @@ typedef enum comp_type
|
||||
VIDEO_LAYOUT_C_LED_16,
|
||||
VIDEO_LAYOUT_C_LED_16_SC,
|
||||
VIDEO_LAYOUT_C_REEL
|
||||
}
|
||||
comp_type_t;
|
||||
} comp_type_t;
|
||||
|
||||
union comp_attr
|
||||
{
|
||||
@@ -43,8 +42,7 @@ typedef struct component
|
||||
video_layout_color_t color;
|
||||
int enabled_state;
|
||||
union comp_attr attr;
|
||||
}
|
||||
component_t;
|
||||
} component_t;
|
||||
|
||||
void component_init (component_t *comp, comp_type_t type);
|
||||
void component_copy (component_t *comp, const component_t *src);
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
typedef struct c_attr_screen
|
||||
{
|
||||
int index;
|
||||
}
|
||||
c_attr_screen_t;
|
||||
} c_attr_screen_t;
|
||||
|
||||
typedef struct c_attr_image
|
||||
{
|
||||
@@ -14,22 +13,19 @@ typedef struct c_attr_image
|
||||
int image_idx;
|
||||
int alpha_idx;
|
||||
bool loaded;
|
||||
}
|
||||
c_attr_image_t;
|
||||
} c_attr_image_t;
|
||||
|
||||
typedef struct c_attr_text
|
||||
{
|
||||
char *string;
|
||||
video_layout_text_align_t align;
|
||||
}
|
||||
c_attr_text_t;
|
||||
} c_attr_text_t;
|
||||
|
||||
typedef struct c_attr_counter
|
||||
{
|
||||
int digits;
|
||||
int max_state;
|
||||
video_layout_text_align_t align;
|
||||
}
|
||||
c_attr_counter_t;
|
||||
} c_attr_counter_t;
|
||||
|
||||
#endif
|
||||
@@ -15,7 +15,7 @@ void element_init(element_t *elem, const char *name, int components_count)
|
||||
elem->render_bounds = make_bounds_unit();
|
||||
|
||||
elem->components = (component_t*)(components_count > 0 ?
|
||||
calloc(components_count, sizeof(component_t)) : NULL);
|
||||
calloc(components_count, sizeof(component_t)) : NULL);
|
||||
elem->components_count = components_count;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ void element_copy(element_t *elem, const element_t *src)
|
||||
elem->render_bounds = src->render_bounds;
|
||||
|
||||
elem->components = (component_t*)(src->components_count > 0 ?
|
||||
calloc(src->components_count, sizeof(component_t)) : NULL);
|
||||
calloc(src->components_count, sizeof(component_t)) : NULL);
|
||||
|
||||
for (i = 0; i < src->components_count; ++i)
|
||||
component_copy(&elem->components[i], &src->components[i]);
|
||||
@@ -40,7 +40,7 @@ void element_copy(element_t *elem, const element_t *src)
|
||||
|
||||
void element_deinit(element_t *elem)
|
||||
{
|
||||
int i;
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < elem->components_count; ++i)
|
||||
component_deinit(&elem->components[i]);
|
||||
@@ -51,12 +51,11 @@ void element_deinit(element_t *elem)
|
||||
|
||||
void element_apply_orientation(element_t *elem, video_layout_orientation_t orientation)
|
||||
{
|
||||
int i;
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < elem->components_count; ++i)
|
||||
{
|
||||
component_t *comp;
|
||||
comp = &elem->components[i];
|
||||
component_t *comp = &elem->components[i];
|
||||
comp->orientation ^= orientation;
|
||||
|
||||
if (orientation & VIDEO_LAYOUT_SWAP_XY)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#ifndef VIDEO_LAYOUT_ELEMENT_H
|
||||
#define VIDEO_LAYOUT_ELEMENT_H
|
||||
|
||||
#include "internal.h"
|
||||
#include "component.h"
|
||||
|
||||
@@ -17,8 +18,7 @@ typedef struct element
|
||||
|
||||
component_t *components;
|
||||
int components_count;
|
||||
}
|
||||
element_t;
|
||||
} element_t;
|
||||
|
||||
void element_init (element_t *elem, const char *name, int components_count);
|
||||
void element_copy (element_t *elem, const element_t *src);
|
||||
|
||||
@@ -66,9 +66,7 @@ int get_int(const char *str)
|
||||
|
||||
float get_dec(const char *str)
|
||||
{
|
||||
float res;
|
||||
|
||||
res = 0.0f;
|
||||
float res = 0.0f;
|
||||
sscanf(str, "%f", &res);
|
||||
|
||||
return res;
|
||||
@@ -152,12 +150,16 @@ video_layout_bounds_t make_bounds_unit(void)
|
||||
return bounds;
|
||||
}
|
||||
|
||||
video_layout_bounds_t bounds_union(const video_layout_bounds_t *a, const video_layout_bounds_t *b)
|
||||
video_layout_bounds_t bounds_union(
|
||||
const video_layout_bounds_t *a,
|
||||
const video_layout_bounds_t *b)
|
||||
{
|
||||
video_layout_bounds_t bounds;
|
||||
|
||||
if (!bounds_valid(a)) return *b;
|
||||
if (!bounds_valid(b)) return *a;
|
||||
if (!bounds_valid(a))
|
||||
return *b;
|
||||
if (!bounds_valid(b))
|
||||
return *a;
|
||||
|
||||
bounds.x = MIN(a->x, b->x);
|
||||
bounds.y = MIN(a->y, b->y);
|
||||
@@ -167,7 +169,9 @@ video_layout_bounds_t bounds_union(const video_layout_bounds_t *a, const video_l
|
||||
return bounds;
|
||||
}
|
||||
|
||||
void bounds_scale(video_layout_bounds_t *dst, const video_layout_bounds_t *dim)
|
||||
void bounds_scale(
|
||||
video_layout_bounds_t *dst,
|
||||
const video_layout_bounds_t *dim)
|
||||
{
|
||||
dst->x *= dim->w;
|
||||
dst->y *= dim->h;
|
||||
|
||||
+75
-99
@@ -52,10 +52,8 @@ static const char *const video_layout_internal_screen_params[] =
|
||||
|
||||
static int child_count(rxml_node_t *node)
|
||||
{
|
||||
int res;
|
||||
rxml_node_t *child;
|
||||
|
||||
res = 0;
|
||||
int res = 0;
|
||||
|
||||
for (child = node->children; child; child = child->next)
|
||||
++res;
|
||||
@@ -102,10 +100,8 @@ static void init_screen_params(scope_t *scope, int screen_index)
|
||||
|
||||
static video_layout_bounds_t parse_bounds(scope_t *scope, rxml_node_t *node)
|
||||
{
|
||||
video_layout_bounds_t bounds;
|
||||
const char *prop;
|
||||
|
||||
bounds = make_bounds_unit();
|
||||
video_layout_bounds_t bounds = make_bounds_unit();
|
||||
|
||||
if ((prop = scope_eval(scope, rxml_node_attrib(node, "x")))) bounds.x = get_dec(prop);
|
||||
if ((prop = scope_eval(scope, rxml_node_attrib(node, "y")))) bounds.y = get_dec(prop);
|
||||
@@ -122,10 +118,8 @@ static video_layout_bounds_t parse_bounds(scope_t *scope, rxml_node_t *node)
|
||||
|
||||
static video_layout_color_t parse_color(scope_t *scope, rxml_node_t *node)
|
||||
{
|
||||
video_layout_color_t color;
|
||||
const char *prop;
|
||||
|
||||
color = make_color_white();
|
||||
video_layout_color_t color = make_color_white();
|
||||
|
||||
if ((prop = scope_eval(scope, rxml_node_attrib(node, "red")))) color.r = get_dec(prop);
|
||||
if ((prop = scope_eval(scope, rxml_node_attrib(node, "green")))) color.g = get_dec(prop);
|
||||
@@ -137,10 +131,8 @@ static video_layout_color_t parse_color(scope_t *scope, rxml_node_t *node)
|
||||
|
||||
static video_layout_orientation_t parse_orientation(scope_t *scope, rxml_node_t *node)
|
||||
{
|
||||
video_layout_orientation_t result;
|
||||
const char *prop;
|
||||
|
||||
result = VIDEO_LAYOUT_ROT0;
|
||||
video_layout_orientation_t result = VIDEO_LAYOUT_ROT0;
|
||||
|
||||
if ((prop = scope_eval(scope, rxml_node_attrib(node, "rotate"))))
|
||||
{
|
||||
@@ -223,14 +215,11 @@ static bool load_param(scope_t *scope, rxml_node_t *node, bool can_repeat)
|
||||
|
||||
static bool load_component(scope_t *scope, component_t *comp, rxml_node_t *node)
|
||||
{
|
||||
comp_type_t type;
|
||||
bool result;
|
||||
const char *state;
|
||||
const char *attr;
|
||||
rxml_node_t *n;
|
||||
|
||||
type = comp_type_from_str(node->name);
|
||||
result = true;
|
||||
comp_type_t type = comp_type_from_str(node->name);
|
||||
bool result = true;
|
||||
|
||||
if (type == VIDEO_LAYOUT_C_UNKNOWN)
|
||||
{
|
||||
@@ -254,72 +243,72 @@ static bool load_component(scope_t *scope, component_t *comp, rxml_node_t *node)
|
||||
|
||||
switch (comp->type)
|
||||
{
|
||||
case VIDEO_LAYOUT_C_UNKNOWN:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_SCREEN:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_RECT:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DISK:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_IMAGE:
|
||||
{
|
||||
if (!(attr = rxml_node_attrib(node, "file")))
|
||||
case VIDEO_LAYOUT_C_UNKNOWN:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_SCREEN:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_RECT:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DISK:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_IMAGE:
|
||||
{
|
||||
RARCH_LOG("video_layout: invalid component <%s />, missing 'file' attribute\n", node->name);
|
||||
result = false;
|
||||
}
|
||||
set_string(&comp->attr.image.file, scope_eval(scope, attr));
|
||||
if (!(attr = rxml_node_attrib(node, "file")))
|
||||
{
|
||||
RARCH_LOG("video_layout: invalid component <%s />, missing 'file' attribute\n", node->name);
|
||||
result = false;
|
||||
}
|
||||
set_string(&comp->attr.image.file, scope_eval(scope, attr));
|
||||
|
||||
if ((attr = rxml_node_attrib(node, "alphafile")))
|
||||
set_string(&comp->attr.image.alpha_file, scope_eval(scope, attr));
|
||||
}
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_TEXT:
|
||||
{
|
||||
if (!(attr = rxml_node_attrib(node, "string")))
|
||||
if ((attr = rxml_node_attrib(node, "alphafile")))
|
||||
set_string(&comp->attr.image.alpha_file, scope_eval(scope, attr));
|
||||
}
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_TEXT:
|
||||
{
|
||||
RARCH_LOG("video_layout: invalid component <%s />, missing 'string' attribute\n", node->name);
|
||||
result = false;
|
||||
if (!(attr = rxml_node_attrib(node, "string")))
|
||||
{
|
||||
RARCH_LOG("video_layout: invalid component <%s />, missing 'string' attribute\n", node->name);
|
||||
result = false;
|
||||
}
|
||||
set_string(&comp->attr.text.string, scope_eval(scope, attr));
|
||||
|
||||
if ((attr = rxml_node_attrib(node, "align")))
|
||||
comp->attr.text.align = (video_layout_text_align_t)get_int(scope_eval(scope, attr));
|
||||
}
|
||||
set_string(&comp->attr.text.string, scope_eval(scope, attr));
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_COUNTER:
|
||||
{
|
||||
if ((attr = rxml_node_attrib(node, "digits")))
|
||||
comp->attr.counter.digits = get_int(scope_eval(scope, attr));
|
||||
|
||||
if ((attr = rxml_node_attrib(node, "align")))
|
||||
comp->attr.text.align = (video_layout_text_align_t)get_int(scope_eval(scope, attr));
|
||||
}
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_COUNTER:
|
||||
{
|
||||
if ((attr = rxml_node_attrib(node, "digits")))
|
||||
comp->attr.counter.digits = get_int(scope_eval(scope, attr));
|
||||
if ((attr = rxml_node_attrib(node, "maxstate")))
|
||||
comp->attr.counter.max_state = get_int(scope_eval(scope, attr));
|
||||
|
||||
if ((attr = rxml_node_attrib(node, "maxstate")))
|
||||
comp->attr.counter.max_state = get_int(scope_eval(scope, attr));
|
||||
|
||||
if ((attr = rxml_node_attrib(node, "align")))
|
||||
comp->attr.counter.align = (video_layout_text_align_t)get_int(scope_eval(scope, attr));
|
||||
}
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_X1:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_H5:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_H8:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_7:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_8_GTS1:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_14:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_14_SC:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_16:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_16_SC:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_REEL:
|
||||
break;
|
||||
if ((attr = rxml_node_attrib(node, "align")))
|
||||
comp->attr.counter.align = (video_layout_text_align_t)get_int(scope_eval(scope, attr));
|
||||
}
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_X1:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_H5:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_DOTMATRIX_H8:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_7:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_8_GTS1:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_14:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_14_SC:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_16:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_LED_16_SC:
|
||||
break;
|
||||
case VIDEO_LAYOUT_C_REEL:
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -329,13 +318,11 @@ static bool load_element(scope_t *scope, rxml_node_t *node)
|
||||
{
|
||||
const char *name;
|
||||
const char *state;
|
||||
bool result;
|
||||
int i;
|
||||
element_t *elem;
|
||||
rxml_node_t *n;
|
||||
video_layout_bounds_t dim;
|
||||
|
||||
result = true;
|
||||
bool result = true;
|
||||
|
||||
if (!(name = rxml_node_attrib(node, "name")))
|
||||
{
|
||||
@@ -394,10 +381,8 @@ static bool load_element(scope_t *scope, rxml_node_t *node)
|
||||
|
||||
static bool load_screen(scope_t *scope, element_t *elem, rxml_node_t *node)
|
||||
{
|
||||
const char *index;
|
||||
component_t *comp;
|
||||
|
||||
index = rxml_node_attrib(node, "index");
|
||||
const char *index = rxml_node_attrib(node, "index");
|
||||
|
||||
element_init(elem, NULL, 1);
|
||||
comp = &elem->components[0];
|
||||
@@ -412,10 +397,8 @@ static bool load_screen(scope_t *scope, element_t *elem, rxml_node_t *node)
|
||||
static void merge_group(scope_t *scope, view_t *view, view_t *group,
|
||||
bool has_bounds, video_layout_bounds_t n_bounds, video_layout_orientation_t n_orient, video_layout_color_t n_color)
|
||||
{
|
||||
bool constrain;
|
||||
int i, j, k;
|
||||
|
||||
constrain = bounds_valid(&n_bounds);
|
||||
bool constrain = bounds_valid(&n_bounds);
|
||||
|
||||
for (i = 0; i < group->layers_count; ++i)
|
||||
{
|
||||
@@ -471,7 +454,7 @@ static bool load_view(scope_t *scope, view_t *view, rxml_node_t *node, bool is_n
|
||||
view_init(view, scope_eval(scope, name));
|
||||
}
|
||||
|
||||
result = true;
|
||||
result = true;
|
||||
has_bounds = false;
|
||||
|
||||
for (n = node->children; n; n = n->next)
|
||||
@@ -660,10 +643,8 @@ static bool load_group(scope_t *scope, rxml_node_t *node)
|
||||
|
||||
static bool load_top_level(scope_t *scope, int *view_count, rxml_node_t *root)
|
||||
{
|
||||
bool result;
|
||||
rxml_node_t *node;
|
||||
|
||||
result = true;
|
||||
bool result = true;
|
||||
*view_count = 0;
|
||||
|
||||
for (node = root->children; node; node = node->next)
|
||||
@@ -695,12 +676,9 @@ static bool load_top_level(scope_t *scope, int *view_count, rxml_node_t *root)
|
||||
|
||||
static bool load_views(scope_t *scope, view_array_t *view_array, rxml_node_t *root)
|
||||
{
|
||||
bool result;
|
||||
int i;
|
||||
rxml_node_t *node;
|
||||
|
||||
result = true;
|
||||
i = 0;
|
||||
bool result = true;
|
||||
int i = 0;
|
||||
|
||||
for (node = root->children; node; node = node->next)
|
||||
{
|
||||
@@ -730,14 +708,12 @@ static bool load_views(scope_t *scope, view_array_t *view_array, rxml_node_t *ro
|
||||
bool load(view_array_t *view_array, rxml_document_t *doc)
|
||||
{
|
||||
bool result;
|
||||
rxml_node_t *root;
|
||||
scope_t scope;
|
||||
int view_count;
|
||||
|
||||
root = rxml_root_node(doc);
|
||||
rxml_node_t *root = rxml_root_node(doc);
|
||||
|
||||
if (strcmp(root->name, "mamelayout") ||
|
||||
strcmp(rxml_node_attrib(root, "version"), "2"))
|
||||
strcmp(rxml_node_attrib(root, "version"), "2"))
|
||||
{
|
||||
RARCH_LOG("video_layout: invalid MAME Layout file\n");
|
||||
return false;
|
||||
|
||||
+13
-21
@@ -38,15 +38,12 @@ static void param_deinit(param_t *param)
|
||||
|
||||
static param_t *param_find(scope_t *scope, const char *name, int level)
|
||||
{
|
||||
param_t *param;
|
||||
param = scope->param;
|
||||
param_t *param = scope->param;
|
||||
|
||||
while (param && param->level >= level)
|
||||
{
|
||||
if (strcmp(param->name, name) == 0)
|
||||
{
|
||||
return param;
|
||||
}
|
||||
param = param->prev;
|
||||
}
|
||||
|
||||
@@ -55,15 +52,13 @@ static param_t *param_find(scope_t *scope, const char *name, int level)
|
||||
|
||||
void scope_init(scope_t *scope)
|
||||
{
|
||||
scope->level = 0;
|
||||
scope->level = 0;
|
||||
|
||||
scope->param = NULL;
|
||||
|
||||
scope->elements = NULL;
|
||||
scope->param = NULL;
|
||||
scope->elements = NULL;
|
||||
scope->elements_count = 0;
|
||||
|
||||
scope->groups = NULL;
|
||||
scope->groups_count = 0;
|
||||
scope->groups = NULL;
|
||||
scope->groups_count = 0;
|
||||
}
|
||||
|
||||
void scope_deinit(scope_t *scope)
|
||||
@@ -114,7 +109,10 @@ void scope_repeat(scope_t *scope)
|
||||
{
|
||||
param_t *param;
|
||||
|
||||
for (param = scope->param; param && param->level >= scope->level; param = param->prev)
|
||||
for (
|
||||
param = scope->param;
|
||||
param && param->level >= scope->level;
|
||||
param = param->prev)
|
||||
{
|
||||
generator_t *gen;
|
||||
if ((gen = param->generator))
|
||||
@@ -149,12 +147,9 @@ void scope_repeat(scope_t *scope)
|
||||
|
||||
void scope_param(scope_t *scope, const char *name, const char *value)
|
||||
{
|
||||
char *eval_name;
|
||||
char *eval_value;
|
||||
param_t *param;
|
||||
|
||||
eval_name = init_string(scope_eval(scope, name));
|
||||
eval_value = init_string(scope_eval(scope, value));
|
||||
char *eval_name = init_string(scope_eval(scope, name));
|
||||
char *eval_value = init_string(scope_eval(scope, value));
|
||||
|
||||
if ((param = param_find(scope, eval_name, scope->level)))
|
||||
{
|
||||
@@ -177,13 +172,11 @@ void scope_param(scope_t *scope, const char *name, const char *value)
|
||||
|
||||
void scope_generator(scope_t *scope, const char *name, const char *start, const char *increment, const char *lshift, const char *rshift)
|
||||
{
|
||||
char *e_name;
|
||||
char *e_val;
|
||||
char *e_inc;
|
||||
generator_t *gen;
|
||||
param_t *param;
|
||||
|
||||
e_name = init_string(scope_eval(scope, name));
|
||||
char *e_name = init_string(scope_eval(scope, name));
|
||||
|
||||
if (param_find(scope, e_name, scope->level))
|
||||
{
|
||||
@@ -234,7 +227,6 @@ const char *scope_eval(scope_t *scope, const char *src)
|
||||
{
|
||||
const char* next;
|
||||
bool in_var;
|
||||
|
||||
char tmp[SCOPE_BUFFER_SIZE];
|
||||
|
||||
if (!src)
|
||||
|
||||
@@ -21,8 +21,7 @@ typedef struct scope
|
||||
int groups_count;
|
||||
|
||||
char eval[SCOPE_BUFFER_SIZE];
|
||||
}
|
||||
scope_t;
|
||||
} scope_t;
|
||||
|
||||
void scope_init (scope_t *scope);
|
||||
void scope_deinit (scope_t *scope);
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#ifndef VIDEO_LAYOUT_TYPES_H
|
||||
#define VIDEO_LAYOUT_TYPES_H
|
||||
|
||||
typedef unsigned char video_layout_orientation_t;
|
||||
#include <stdint.h>
|
||||
|
||||
typedef uint8_t video_layout_orientation_t;
|
||||
|
||||
#define VIDEO_LAYOUT_FLIP_X 1
|
||||
#define VIDEO_LAYOUT_FLIP_Y 2
|
||||
@@ -14,19 +16,17 @@ typedef unsigned char video_layout_orientation_t;
|
||||
|
||||
typedef enum video_layout_blend
|
||||
{
|
||||
VIDEO_LAYOUT_BLEND_ALPHA,
|
||||
VIDEO_LAYOUT_BLEND_ALPHA = 0,
|
||||
VIDEO_LAYOUT_BLEND_ADD,
|
||||
VIDEO_LAYOUT_BLEND_MOD
|
||||
}
|
||||
video_layout_blend_t;
|
||||
} video_layout_blend_t;
|
||||
|
||||
typedef enum video_layout_text_align
|
||||
{
|
||||
VIDEO_LAYOUT_TEXT_ALIGN_CENTER,
|
||||
VIDEO_LAYOUT_TEXT_ALIGN_CENTER = 0,
|
||||
VIDEO_LAYOUT_TEXT_ALIGN_LEFT,
|
||||
VIDEO_LAYOUT_TEXT_ALIGN_RIGHT
|
||||
}
|
||||
video_layout_text_align_t;
|
||||
} video_layout_text_align_t;
|
||||
|
||||
typedef struct video_layout_color
|
||||
{
|
||||
@@ -34,8 +34,7 @@ typedef struct video_layout_color
|
||||
float g;
|
||||
float b;
|
||||
float a;
|
||||
}
|
||||
video_layout_color_t;
|
||||
} video_layout_color_t;
|
||||
|
||||
typedef struct video_layout_bounds
|
||||
{
|
||||
@@ -43,7 +42,6 @@ typedef struct video_layout_bounds
|
||||
float y;
|
||||
float w;
|
||||
float h;
|
||||
}
|
||||
video_layout_bounds_t;
|
||||
} video_layout_bounds_t;
|
||||
|
||||
#endif
|
||||
@@ -26,7 +26,8 @@ element_t *layer_add_element(layer_t *layer)
|
||||
{
|
||||
element_t *elem;
|
||||
|
||||
vec_size((void**)&layer->elements, sizeof(element_t), ++layer->elements_count);
|
||||
vec_size((void**)&layer->elements,
|
||||
sizeof(element_t), ++layer->elements_count);
|
||||
|
||||
elem = &layer->elements[layer->elements_count - 1];
|
||||
element_init(elem, NULL, 0);
|
||||
@@ -36,12 +37,12 @@ element_t *layer_add_element(layer_t *layer)
|
||||
|
||||
void view_init(view_t *view, const char *name)
|
||||
{
|
||||
view->name = init_string(name);
|
||||
view->bounds = make_bounds();
|
||||
view->name = init_string(name);
|
||||
view->bounds = make_bounds();
|
||||
view->render_bounds = make_bounds_unit();
|
||||
view->layers = NULL;
|
||||
view->layers_count = 0;
|
||||
view->screens = NULL;
|
||||
view->layers = NULL;
|
||||
view->layers_count = 0;
|
||||
view->screens = NULL;
|
||||
view->screens_count = 0;
|
||||
}
|
||||
|
||||
@@ -197,9 +198,8 @@ void view_normalize(view_t *view)
|
||||
|
||||
void view_count_screens(view_t *view)
|
||||
{
|
||||
int idx, i, j, k;
|
||||
|
||||
idx = -1;
|
||||
int i, j, k;
|
||||
int idx = -1;
|
||||
|
||||
for (i = 0; i < view->layers_count; ++i)
|
||||
{
|
||||
|
||||
@@ -11,8 +11,7 @@ typedef struct layer
|
||||
|
||||
element_t *elements;
|
||||
int elements_count;
|
||||
}
|
||||
layer_t;
|
||||
} layer_t;
|
||||
|
||||
typedef struct view
|
||||
{
|
||||
@@ -25,15 +24,13 @@ typedef struct view
|
||||
|
||||
video_layout_bounds_t *screens;
|
||||
int screens_count;
|
||||
}
|
||||
view_t;
|
||||
} view_t;
|
||||
|
||||
typedef struct view_array
|
||||
{
|
||||
view_t *views;
|
||||
int views_count;
|
||||
}
|
||||
view_array_t;
|
||||
} view_array_t;
|
||||
|
||||
void layer_init (layer_t *layer, const char *name);
|
||||
void layer_deinit (layer_t *layer);
|
||||
|
||||
+31
-21
@@ -354,22 +354,24 @@ static bool video_shader_parse_textures(config_file_t *conf,
|
||||
fill_pathname_resolve_relative(shader->lut[shader->luts].path,
|
||||
conf->path, tmp_path, sizeof(shader->lut[shader->luts].path));
|
||||
|
||||
|
||||
strlcpy(shader->lut[shader->luts].id, id,
|
||||
sizeof(shader->lut[shader->luts].id));
|
||||
|
||||
snprintf(id_filter, sizeof(id_filter), "%s_linear", id);
|
||||
strlcpy(id_filter, id, sizeof(id_filter));
|
||||
strlcat(id_filter, "_linear", sizeof(id_filter));
|
||||
if (config_get_bool(conf, id_filter, &smooth))
|
||||
shader->lut[shader->luts].filter = smooth ?
|
||||
RARCH_FILTER_LINEAR : RARCH_FILTER_NEAREST;
|
||||
else
|
||||
shader->lut[shader->luts].filter = RARCH_FILTER_UNSPEC;
|
||||
|
||||
snprintf(id_wrap, sizeof(id_wrap), "%s_wrap_mode", id);
|
||||
strlcpy(id_wrap, id, sizeof(id_wrap));
|
||||
strlcat(id_wrap, "_wrap_mode", sizeof(id_wrap));
|
||||
if (config_get_array(conf, id_wrap, wrap_mode, sizeof(wrap_mode)))
|
||||
shader->lut[shader->luts].wrap = wrap_str_to_mode(wrap_mode);
|
||||
|
||||
snprintf(id_mipmap, sizeof(id_mipmap), "%s_mipmap", id);
|
||||
strlcpy(id_mipmap, id, sizeof(id_mipmap));
|
||||
strlcat(id_mipmap, "_mipmap", sizeof(id_mipmap));
|
||||
if (config_get_bool(conf, id_mipmap, &mipmap))
|
||||
shader->lut[shader->luts].mipmap = mipmap;
|
||||
else
|
||||
@@ -1090,10 +1092,6 @@ void video_shader_write_conf_preset(config_file_t *conf,
|
||||
|
||||
for (i = 0; i < shader->luts; i++)
|
||||
{
|
||||
char key[128];
|
||||
|
||||
key[0] = '\0';
|
||||
|
||||
if (preset_path)
|
||||
{
|
||||
strlcpy(tmp, shader->lut[i].path, tmp_size);
|
||||
@@ -1107,20 +1105,31 @@ void video_shader_write_conf_preset(config_file_t *conf,
|
||||
|
||||
if (shader->lut[i].filter != RARCH_FILTER_UNSPEC)
|
||||
{
|
||||
snprintf(key, sizeof(key), "%s_linear", shader->lut[i].id);
|
||||
char key[128];
|
||||
key[0] = '\0';
|
||||
strlcpy(key, shader->lut[i].id, sizeof(key));
|
||||
strlcat(key, "_linear", sizeof(key));
|
||||
config_set_bool(conf, key,
|
||||
shader->lut[i].filter == RARCH_FILTER_LINEAR);
|
||||
}
|
||||
|
||||
snprintf(key, sizeof(key),
|
||||
"%s_wrap_mode", shader->lut[i].id);
|
||||
config_set_string(conf, key,
|
||||
wrap_mode_to_str(shader->lut[i].wrap));
|
||||
{
|
||||
char key[128];
|
||||
key[0] = '\0';
|
||||
strlcpy(key, shader->lut[i].id, sizeof(key));
|
||||
strlcat(key, "_wrap_mode", sizeof(key));
|
||||
config_set_string(conf, key,
|
||||
wrap_mode_to_str(shader->lut[i].wrap));
|
||||
}
|
||||
|
||||
snprintf(key, sizeof(key),
|
||||
"%s_mipmap", shader->lut[i].id);
|
||||
config_set_bool(conf, key,
|
||||
shader->lut[i].mipmap);
|
||||
{
|
||||
char key[128];
|
||||
key[0] = '\0';
|
||||
strlcpy(key, shader->lut[i].id, sizeof(key));
|
||||
strlcat(key, "_mipmap", sizeof(key));
|
||||
config_set_bool(conf, key,
|
||||
shader->lut[i].mipmap);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1159,7 +1168,7 @@ const char *video_shader_to_str(enum rarch_shader_type type)
|
||||
bool video_shader_is_supported(enum rarch_shader_type type)
|
||||
{
|
||||
gfx_ctx_flags_t flags;
|
||||
enum display_flags testflag;
|
||||
enum display_flags testflag = GFX_CTX_FLAGS_NONE;
|
||||
|
||||
flags.flags = 0;
|
||||
|
||||
@@ -1191,12 +1200,12 @@ const char *video_shader_get_preset_extension(enum rarch_shader_type type)
|
||||
switch (type)
|
||||
{
|
||||
case RARCH_SHADER_GLSL:
|
||||
return file_path_str(FILE_PATH_GLSLP_EXTENSION);
|
||||
return ".glslp";
|
||||
case RARCH_SHADER_SLANG:
|
||||
return file_path_str(FILE_PATH_SLANGP_EXTENSION);
|
||||
return ".slangp";
|
||||
case RARCH_SHADER_HLSL:
|
||||
case RARCH_SHADER_CG:
|
||||
return file_path_str(FILE_PATH_CGP_EXTENSION);
|
||||
return ".cgp";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -1207,6 +1216,7 @@ const char *video_shader_get_preset_extension(enum rarch_shader_type type)
|
||||
bool video_shader_any_supported(void)
|
||||
{
|
||||
gfx_ctx_flags_t flags;
|
||||
flags.flags = 0;
|
||||
video_context_driver_get_flags(&flags);
|
||||
|
||||
return
|
||||
|
||||
+2
-1
@@ -157,6 +157,7 @@ ACHIEVEMENTS
|
||||
#endif
|
||||
|
||||
#include "../libretro-common/formats/json/jsonsax.c"
|
||||
#include "../libretro-common/formats/cdfs/cdfs.c"
|
||||
#include "../network/net_http_special.c"
|
||||
|
||||
#include "../cheevos-new/cheevos.c"
|
||||
@@ -405,6 +406,7 @@ VIDEO DRIVER
|
||||
|
||||
#ifdef HAVE_SDL2
|
||||
#include "../gfx/drivers/sdl2_gfx.c"
|
||||
#include "../gfx/common/sdl2_common.c"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_VG
|
||||
@@ -1237,7 +1239,6 @@ MENU
|
||||
#include "../menu/menu_driver.c"
|
||||
#include "../menu/menu_setting.c"
|
||||
#include "../menu/menu_cbs.c"
|
||||
#include "../menu/menu_content.c"
|
||||
|
||||
#if defined(HAVE_NETWORKING)
|
||||
#include "../menu/menu_networking.c"
|
||||
|
||||
@@ -123,10 +123,6 @@ VIDEO DRIVER
|
||||
/*============================================================
|
||||
FONTS
|
||||
============================================================ */
|
||||
#if defined(_XBOX360)
|
||||
#include "../gfx/drivers_font/xdk360_fonts.cpp"
|
||||
#endif
|
||||
|
||||
#ifdef WANT_GLSLANG
|
||||
#ifdef _WIN32
|
||||
#include "../deps/glslang/glslang/glslang/OSDependent/Windows/ossource.cpp"
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
static bool x11_mouse_wu;
|
||||
static bool x11_mouse_wd;
|
||||
static bool x11_mouse_hwu;
|
||||
static bool x11_mouse_hwd;
|
||||
|
||||
int16_t x_mouse_state_wheel(unsigned id)
|
||||
{
|
||||
@@ -35,6 +37,14 @@ int16_t x_mouse_state_wheel(unsigned id)
|
||||
ret = x11_mouse_wd;
|
||||
x11_mouse_wd = 0;
|
||||
return ret;
|
||||
case RETRO_DEVICE_ID_MOUSE_HORIZ_WHEELUP:
|
||||
ret = x11_mouse_hwu;
|
||||
x11_mouse_hwu = 0;
|
||||
return ret;
|
||||
case RETRO_DEVICE_ID_MOUSE_HORIZ_WHEELDOWN:
|
||||
ret = x11_mouse_hwd;
|
||||
x11_mouse_hwd = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -50,5 +60,13 @@ void x_input_poll_wheel(XButtonEvent *event, bool latch)
|
||||
case 5:
|
||||
x11_mouse_wd = 1;
|
||||
break;
|
||||
case 6:
|
||||
/* Scroll wheel left == HORIZ_WHEELDOWN */
|
||||
x11_mouse_hwd = 1;
|
||||
break;
|
||||
case 7:
|
||||
/* Scroll wheel right == HORIZ_WHEELUP */
|
||||
x11_mouse_hwu = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
+192
-4
@@ -32,11 +32,109 @@
|
||||
/* TODO/FIXME -
|
||||
* fix game focus toggle */
|
||||
|
||||
#ifdef HW_RVL
|
||||
/* gx joypad functions */
|
||||
bool gxpad_mousevalid(unsigned port);
|
||||
void gx_joypad_read_mouse(unsigned port, int *irx, int *iry, uint32_t *button);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int x_abs, y_abs;
|
||||
int x_last, y_last;
|
||||
uint32_t button;
|
||||
} gx_input_mouse_t;
|
||||
#endif
|
||||
|
||||
typedef struct gx_input
|
||||
{
|
||||
const input_device_driver_t *joypad;
|
||||
#ifdef HW_RVL
|
||||
int mouse_max;
|
||||
gx_input_mouse_t *mouse;
|
||||
#endif
|
||||
} gx_input_t;
|
||||
|
||||
#ifdef HW_RVL
|
||||
static int16_t gx_lightgun_state(gx_input_t *gx, unsigned id, uint16_t joy_idx)
|
||||
{
|
||||
struct video_viewport vp = {0};
|
||||
video_driver_get_viewport_info(&vp);
|
||||
int16_t res_x = 0;
|
||||
int16_t res_y = 0;
|
||||
int16_t res_screen_x = 0;
|
||||
int16_t res_screen_y = 0;
|
||||
int16_t x = 0;
|
||||
int16_t y = 0;
|
||||
|
||||
vp.x = 0;
|
||||
vp.y = 0;
|
||||
vp.width = 0;
|
||||
vp.height = 0;
|
||||
vp.full_width = 0;
|
||||
vp.full_height = 0;
|
||||
|
||||
x = gx->mouse[joy_idx].x_abs;
|
||||
y = gx->mouse[joy_idx].y_abs;
|
||||
|
||||
if (!(video_driver_translate_coord_viewport_wrap(&vp, x, y,
|
||||
&res_x, &res_y, &res_screen_x, &res_screen_y)))
|
||||
return 0;
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_SCREEN_X:
|
||||
return res_screen_x;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_SCREEN_Y:
|
||||
return res_screen_y;
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_TRIGGER:
|
||||
return gx->mouse[joy_idx].button & (1 << RETRO_DEVICE_ID_LIGHTGUN_TRIGGER);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_A:
|
||||
return gx->mouse[joy_idx].button & (1 << RETRO_DEVICE_ID_LIGHTGUN_AUX_A);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_B:
|
||||
return gx->mouse[joy_idx].button & (1 << RETRO_DEVICE_ID_LIGHTGUN_AUX_B);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_C:
|
||||
return gx->mouse[joy_idx].button & (1 << RETRO_DEVICE_ID_LIGHTGUN_AUX_C);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_START:
|
||||
return gx->mouse[joy_idx].button & (1 << RETRO_DEVICE_ID_LIGHTGUN_START);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_SELECT:
|
||||
return gx->mouse[joy_idx].button & (1 << RETRO_DEVICE_ID_LIGHTGUN_SELECT);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_IS_OFFSCREEN:
|
||||
return !gxpad_mousevalid(joy_idx);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int16_t gx_mouse_state(gx_input_t *gx, unsigned id, uint16_t joy_idx)
|
||||
{
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
|
||||
settings_t *settings = config_get_ptr();
|
||||
int x_scale = settings->uints.input_mouse_scale;
|
||||
int y_scale = settings->uints.input_mouse_scale;
|
||||
|
||||
x = (gx->mouse[joy_idx].x_abs - gx->mouse[joy_idx].x_last) * x_scale;
|
||||
y = (gx->mouse[joy_idx].y_abs - gx->mouse[joy_idx].y_last) * y_scale;
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case RETRO_DEVICE_ID_MOUSE_X:
|
||||
return x;
|
||||
case RETRO_DEVICE_ID_MOUSE_Y:
|
||||
return y;
|
||||
case RETRO_DEVICE_ID_MOUSE_LEFT:
|
||||
return gx->mouse[joy_idx].button & (1 << RETRO_DEVICE_ID_MOUSE_LEFT);
|
||||
case RETRO_DEVICE_ID_MOUSE_RIGHT:
|
||||
return gx->mouse[joy_idx].button & (1 << RETRO_DEVICE_ID_MOUSE_RIGHT);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static int16_t gx_input_state(void *data,
|
||||
rarch_joypad_info_t joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
@@ -96,6 +194,13 @@ static int16_t gx_input_state(void *data,
|
||||
return input_joypad_analog(gx->joypad,
|
||||
joypad_info, port, idx, id, binds[port]);
|
||||
break;
|
||||
#ifdef HW_RVL
|
||||
case RETRO_DEVICE_MOUSE:
|
||||
return gx_mouse_state(gx, id, joypad_info.joy_idx);
|
||||
|
||||
case RETRO_DEVICE_LIGHTGUN:
|
||||
return gx_lightgun_state(gx, id, joypad_info.joy_idx);
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -110,10 +215,36 @@ static void gx_input_free_input(void *data)
|
||||
|
||||
if (gx->joypad)
|
||||
gx->joypad->destroy();
|
||||
|
||||
#ifdef HW_RVL
|
||||
if(gx->mouse)
|
||||
free(gx->mouse);
|
||||
#endif
|
||||
free(gx);
|
||||
}
|
||||
|
||||
#ifdef HW_RVL
|
||||
static inline int gx_count_mouse(gx_input_t *gx)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
if(gx)
|
||||
{
|
||||
for(int i=0; i<DEFAULT_MAX_PADS; i++)
|
||||
{
|
||||
if(gx->joypad->name(i))
|
||||
{
|
||||
if(!strcmp(gx->joypad->name(i), "Wiimote Controller"))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void *gx_input_init(const char *joypad_driver)
|
||||
{
|
||||
gx_input_t *gx = (gx_input_t*)calloc(1, sizeof(*gx));
|
||||
@@ -121,23 +252,80 @@ static void *gx_input_init(const char *joypad_driver)
|
||||
return NULL;
|
||||
|
||||
gx->joypad = input_joypad_init_driver(joypad_driver, gx);
|
||||
|
||||
#ifdef HW_RVL
|
||||
/* Allocate at least 1 mouse at startup */
|
||||
gx->mouse_max = 1;
|
||||
gx->mouse = (gx_input_mouse_t*) calloc(gx->mouse_max, sizeof(gx_input_mouse_t));
|
||||
#endif
|
||||
return gx;
|
||||
}
|
||||
|
||||
#ifdef HW_RVL
|
||||
static void gx_input_poll_mouse(gx_input_t *gx)
|
||||
{
|
||||
int count = 0;
|
||||
count = gx_count_mouse(gx);
|
||||
|
||||
if(gx && count > 0)
|
||||
{
|
||||
if(count != gx->mouse_max)
|
||||
{
|
||||
gx_input_mouse_t* tmp = NULL;
|
||||
|
||||
tmp = (gx_input_mouse_t*)realloc(gx->mouse, count * sizeof(gx_input_mouse_t));
|
||||
if(!tmp)
|
||||
{
|
||||
free(gx->mouse);
|
||||
}
|
||||
else
|
||||
{
|
||||
gx->mouse = tmp;
|
||||
gx->mouse_max = count;
|
||||
|
||||
for(int i=0; i<gx->mouse_max; i++)
|
||||
{
|
||||
gx->mouse[i].x_last = 0;
|
||||
gx->mouse[i].y_last = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(unsigned i=0; i<gx->mouse_max; i++)
|
||||
{
|
||||
gx->mouse[i].x_last = gx->mouse[i].x_abs;
|
||||
gx->mouse[i].y_last = gx->mouse[i].y_abs;
|
||||
gx_joypad_read_mouse(i, &gx->mouse[i].x_abs, &gx->mouse[i].y_abs, &gx->mouse[i].button);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void gx_input_poll(void *data)
|
||||
{
|
||||
gx_input_t *gx = (gx_input_t*)data;
|
||||
|
||||
if (gx && gx->joypad)
|
||||
{
|
||||
gx->joypad->poll();
|
||||
#ifdef HW_RVL
|
||||
if(gx->mouse)
|
||||
gx_input_poll_mouse(gx);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static uint64_t gx_input_get_capabilities(void *data)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
return (1 << RETRO_DEVICE_JOYPAD) | (1 << RETRO_DEVICE_ANALOG);
|
||||
#ifdef HW_RVL
|
||||
return (1 << RETRO_DEVICE_JOYPAD) |
|
||||
(1 << RETRO_DEVICE_ANALOG) |
|
||||
(1 << RETRO_DEVICE_MOUSE) |
|
||||
(1 << RETRO_DEVICE_LIGHTGUN);
|
||||
#else
|
||||
return (1 << RETRO_DEVICE_JOYPAD) |
|
||||
(1 << RETRO_DEVICE_ANALOG);
|
||||
#endif
|
||||
}
|
||||
|
||||
static const input_device_driver_t *gx_input_get_joypad_driver(void *data)
|
||||
|
||||
@@ -519,7 +519,7 @@ static bool udev_input_add_device(udev_input_t *udev,
|
||||
else
|
||||
{
|
||||
device->mouse.x_min = absinfo.minimum;
|
||||
device->mouse.x_min = absinfo.maximum;
|
||||
device->mouse.x_max = absinfo.maximum;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -533,7 +533,7 @@ static bool udev_input_add_device(udev_input_t *udev,
|
||||
else
|
||||
{
|
||||
device->mouse.y_min = absinfo.minimum;
|
||||
device->mouse.y_min = absinfo.maximum;
|
||||
device->mouse.y_max = absinfo.maximum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loaded 100 of 290 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user