diff options
92 files changed, 696 insertions, 428 deletions
diff --git a/dist/icons/overlay/osk_button_B.png b/dist/icons/overlay/osk_button_B.png index f4a041178..2664b5923 100644 --- a/dist/icons/overlay/osk_button_B.png +++ b/dist/icons/overlay/osk_button_B.png | |||
| Binary files differ | |||
diff --git a/dist/icons/overlay/osk_button_B_dark.png b/dist/icons/overlay/osk_button_B_dark.png index 2d2bffcca..1bd374571 100644 --- a/dist/icons/overlay/osk_button_B_dark.png +++ b/dist/icons/overlay/osk_button_B_dark.png | |||
| Binary files differ | |||
diff --git a/dist/icons/overlay/osk_button_B_dark_disabled.png b/dist/icons/overlay/osk_button_B_dark_disabled.png index 93c102b1b..3b88e393c 100644 --- a/dist/icons/overlay/osk_button_B_dark_disabled.png +++ b/dist/icons/overlay/osk_button_B_dark_disabled.png | |||
| Binary files differ | |||
diff --git a/dist/icons/overlay/osk_button_B_disabled.png b/dist/icons/overlay/osk_button_B_disabled.png index 5900982f6..0f35cd8f2 100644 --- a/dist/icons/overlay/osk_button_B_disabled.png +++ b/dist/icons/overlay/osk_button_B_disabled.png | |||
| Binary files differ | |||
diff --git a/dist/icons/overlay/osk_button_Y.png b/dist/icons/overlay/osk_button_Y.png index b08b4e26b..2cd193481 100644 --- a/dist/icons/overlay/osk_button_Y.png +++ b/dist/icons/overlay/osk_button_Y.png | |||
| Binary files differ | |||
diff --git a/dist/icons/overlay/osk_button_Y_dark.png b/dist/icons/overlay/osk_button_Y_dark.png index 1fba9ca93..0cce567d3 100644 --- a/dist/icons/overlay/osk_button_Y_dark.png +++ b/dist/icons/overlay/osk_button_Y_dark.png | |||
| Binary files differ | |||
diff --git a/dist/icons/overlay/osk_button_Y_dark_disabled.png b/dist/icons/overlay/osk_button_Y_dark_disabled.png index 6ce53f9e4..de619efa3 100644 --- a/dist/icons/overlay/osk_button_Y_dark_disabled.png +++ b/dist/icons/overlay/osk_button_Y_dark_disabled.png | |||
| Binary files differ | |||
diff --git a/dist/icons/overlay/osk_button_Y_disabled.png b/dist/icons/overlay/osk_button_Y_disabled.png index 25db07f66..8d607bc12 100644 --- a/dist/icons/overlay/osk_button_Y_disabled.png +++ b/dist/icons/overlay/osk_button_Y_disabled.png | |||
| Binary files differ | |||
diff --git a/dist/icons/overlay/osk_button_plus.png b/dist/icons/overlay/osk_button_plus.png index 5baa5201e..9f9787419 100644 --- a/dist/icons/overlay/osk_button_plus.png +++ b/dist/icons/overlay/osk_button_plus.png | |||
| Binary files differ | |||
diff --git a/dist/icons/overlay/osk_button_plus_dark.png b/dist/icons/overlay/osk_button_plus_dark.png index 4cadb438b..dbe7b0c66 100644 --- a/dist/icons/overlay/osk_button_plus_dark.png +++ b/dist/icons/overlay/osk_button_plus_dark.png | |||
| Binary files differ | |||
diff --git a/dist/icons/overlay/osk_button_plus_dark_disabled.png b/dist/icons/overlay/osk_button_plus_dark_disabled.png index b8eb8dc3d..a79af6501 100644 --- a/dist/icons/overlay/osk_button_plus_dark_disabled.png +++ b/dist/icons/overlay/osk_button_plus_dark_disabled.png | |||
| Binary files differ | |||
diff --git a/dist/icons/overlay/osk_button_plus_disabled.png b/dist/icons/overlay/osk_button_plus_disabled.png index c23e9d95d..52ace8eca 100644 --- a/dist/icons/overlay/osk_button_plus_disabled.png +++ b/dist/icons/overlay/osk_button_plus_disabled.png | |||
| Binary files differ | |||
diff --git a/dist/icons/overlay/osk_button_shift_lock_off.png b/dist/icons/overlay/osk_button_shift_lock_off.png index 585500b3a..b506f456f 100644 --- a/dist/icons/overlay/osk_button_shift_lock_off.png +++ b/dist/icons/overlay/osk_button_shift_lock_off.png | |||
| Binary files differ | |||
diff --git a/dist/icons/overlay/osk_button_shift_lock_on.png b/dist/icons/overlay/osk_button_shift_lock_on.png index 09077ab01..eaa4e98ed 100644 --- a/dist/icons/overlay/osk_button_shift_lock_on.png +++ b/dist/icons/overlay/osk_button_shift_lock_on.png | |||
| Binary files differ | |||
diff --git a/dist/license.md b/dist/license.md index e9bc87656..7bdebfec1 100644 --- a/dist/license.md +++ b/dist/license.md | |||
| @@ -12,6 +12,7 @@ qt_themes/default/icons/48x48/chip.png | CC BY-ND 3.0 | https://icons8.com | |||
| 12 | qt_themes/default/icons/48x48/folder.png | CC BY-ND 3.0 | https://icons8.com | 12 | qt_themes/default/icons/48x48/folder.png | CC BY-ND 3.0 | https://icons8.com |
| 13 | qt_themes/default/icons/48x48/plus.png | CC0 1.0 | Designed by BreadFish64 from the Citra team | 13 | qt_themes/default/icons/48x48/plus.png | CC0 1.0 | Designed by BreadFish64 from the Citra team |
| 14 | qt_themes/default/icons/48x48/sd_card.png | CC BY-ND 3.0 | https://icons8.com | 14 | qt_themes/default/icons/48x48/sd_card.png | CC BY-ND 3.0 | https://icons8.com |
| 15 | qt_themes/default/icons/48x48/star.png | CC BY-ND 3.0 | https://icons8.com | ||
| 15 | qt_themes/qdarkstyle/icons/16x16/lock.png | CC BY-ND 3.0 | https://icons8.com | 16 | qt_themes/qdarkstyle/icons/16x16/lock.png | CC BY-ND 3.0 | https://icons8.com |
| 16 | qt_themes/qdarkstyle/icons/16x16/view-refresh.png | Apache 2.0 | https://material.io | 17 | qt_themes/qdarkstyle/icons/16x16/view-refresh.png | Apache 2.0 | https://material.io |
| 17 | qt_themes/qdarkstyle/icons/256x256/plus_folder.png | CC BY-ND 3.0 | https://icons8.com | 18 | qt_themes/qdarkstyle/icons/256x256/plus_folder.png | CC BY-ND 3.0 | https://icons8.com |
| @@ -20,6 +21,7 @@ qt_themes/qdarkstyle/icons/48x48/chip.png | CC BY-ND 3.0 | https://icons8.com | |||
| 20 | qt_themes/qdarkstyle/icons/48x48/folder.png | CC BY-ND 3.0 | https://icons8.com | 21 | qt_themes/qdarkstyle/icons/48x48/folder.png | CC BY-ND 3.0 | https://icons8.com |
| 21 | qt_themes/qdarkstyle/icons/48x48/plus.png | CC0 1.0 | Designed by BreadFish64 from the Citra team | 22 | qt_themes/qdarkstyle/icons/48x48/plus.png | CC0 1.0 | Designed by BreadFish64 from the Citra team |
| 22 | qt_themes/qdarkstyle/icons/48x48/sd_card.png | CC BY-ND 3.0 | https://icons8.com | 23 | qt_themes/qdarkstyle/icons/48x48/sd_card.png | CC BY-ND 3.0 | https://icons8.com |
| 24 | qt_themes/qdarkstyle/icons/48x48/star.png | CC BY-ND 3.0 | https://icons8.com | ||
| 23 | qt_themes/colorful/icons/16x16/lock.png | CC BY-ND 3.0 | https://icons8.com | 25 | qt_themes/colorful/icons/16x16/lock.png | CC BY-ND 3.0 | https://icons8.com |
| 24 | qt_themes/colorful/icons/16x16/view-refresh.png | Apache 2.0 | https://material.io | 26 | qt_themes/colorful/icons/16x16/view-refresh.png | Apache 2.0 | https://material.io |
| 25 | qt_themes/colorful/icons/256x256/plus_folder.png | CC BY-ND 3.0 | https://icons8.com | 27 | qt_themes/colorful/icons/256x256/plus_folder.png | CC BY-ND 3.0 | https://icons8.com |
| @@ -28,5 +30,6 @@ qt_themes/colorful/icons/48x48/chip.png | CC BY-ND 3.0 | https://icons8.com | |||
| 28 | qt_themes/colorful/icons/48x48/folder.png | CC BY-ND 3.0 | https://icons8.com | 30 | qt_themes/colorful/icons/48x48/folder.png | CC BY-ND 3.0 | https://icons8.com |
| 29 | qt_themes/colorful/icons/48x48/plus.png | CC BY-ND 3.0 | https://icons8.com | 31 | qt_themes/colorful/icons/48x48/plus.png | CC BY-ND 3.0 | https://icons8.com |
| 30 | qt_themes/colorful/icons/48x48/sd_card.png | CC BY-ND 3.0 | https://icons8.com | 32 | qt_themes/colorful/icons/48x48/sd_card.png | CC BY-ND 3.0 | https://icons8.com |
| 33 | qt_themes/colorful/icons/48x48/star.png | CC BY-ND 3.0 | https://icons8.com | ||
| 31 | 34 | ||
| 32 | <!-- TODO: Add the license of the yuzu icon --> \ No newline at end of file | 35 | <!-- TODO: Add the license of the yuzu icon --> \ No newline at end of file |
diff --git a/dist/qt_themes/colorful/icons/48x48/star.png b/dist/qt_themes/colorful/icons/48x48/star.png new file mode 100644 index 000000000..43b5d52ed --- /dev/null +++ b/dist/qt_themes/colorful/icons/48x48/star.png | |||
| Binary files differ | |||
diff --git a/dist/qt_themes/colorful/style.qrc b/dist/qt_themes/colorful/style.qrc index 36735519a..18b10869e 100644 --- a/dist/qt_themes/colorful/style.qrc +++ b/dist/qt_themes/colorful/style.qrc | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | <file alias="48x48/folder.png">icons/48x48/folder.png</file> | 7 | <file alias="48x48/folder.png">icons/48x48/folder.png</file> |
| 8 | <file alias="48x48/plus.png">icons/48x48/plus.png</file> | 8 | <file alias="48x48/plus.png">icons/48x48/plus.png</file> |
| 9 | <file alias="48x48/sd_card.png">icons/48x48/sd_card.png</file> | 9 | <file alias="48x48/sd_card.png">icons/48x48/sd_card.png</file> |
| 10 | <file alias="48x48/star.png">icons/48x48/star.png</file> | ||
| 10 | <file alias="256x256/plus_folder.png">icons/256x256/plus_folder.png</file> | 11 | <file alias="256x256/plus_folder.png">icons/256x256/plus_folder.png</file> |
| 11 | </qresource> | 12 | </qresource> |
| 12 | <qresource prefix="colorful"> | 13 | <qresource prefix="colorful"> |
diff --git a/dist/qt_themes/default/default.qrc b/dist/qt_themes/default/default.qrc index 2182f33f3..b195747a3 100644 --- a/dist/qt_themes/default/default.qrc +++ b/dist/qt_themes/default/default.qrc | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | <file alias="48x48/folder.png">icons/48x48/folder.png</file> | 10 | <file alias="48x48/folder.png">icons/48x48/folder.png</file> |
| 11 | <file alias="48x48/plus.png">icons/48x48/plus.png</file> | 11 | <file alias="48x48/plus.png">icons/48x48/plus.png</file> |
| 12 | <file alias="48x48/sd_card.png">icons/48x48/sd_card.png</file> | 12 | <file alias="48x48/sd_card.png">icons/48x48/sd_card.png</file> |
| 13 | <file alias="48x48/star.png">icons/48x48/star.png</file> | ||
| 13 | <file alias="256x256/yuzu.png">icons/256x256/yuzu.png</file> | 14 | <file alias="256x256/yuzu.png">icons/256x256/yuzu.png</file> |
| 14 | <file alias="256x256/plus_folder.png">icons/256x256/plus_folder.png</file> | 15 | <file alias="256x256/plus_folder.png">icons/256x256/plus_folder.png</file> |
| 15 | </qresource> | 16 | </qresource> |
diff --git a/dist/qt_themes/default/icons/48x48/star.png b/dist/qt_themes/default/icons/48x48/star.png new file mode 100644 index 000000000..740f7f3e7 --- /dev/null +++ b/dist/qt_themes/default/icons/48x48/star.png | |||
| Binary files differ | |||
diff --git a/dist/qt_themes/default/style.qss b/dist/qt_themes/default/style.qss index 3bc92b69d..cee219374 100644 --- a/dist/qt_themes/default/style.qss +++ b/dist/qt_themes/default/style.qss | |||
| @@ -515,45 +515,35 @@ QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:pressed { | |||
| 515 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace, | 515 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace, |
| 516 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift, | 516 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift, |
| 517 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num { | 517 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num { |
| 518 | background-position: right top; | 518 | image: url(:/overlay/osk_button_B.png); |
| 519 | background-repeat: no-repeat; | 519 | image-position: right; |
| 520 | background-origin: content; | ||
| 521 | background-image: url(:/overlay/osk_button_B.png); | ||
| 522 | qproperty-icon: url(:/overlay/osk_button_backspace.png); | 520 | qproperty-icon: url(:/overlay/osk_button_backspace.png); |
| 523 | qproperty-iconSize: 36px; | 521 | qproperty-iconSize: 36px; |
| 524 | } | 522 | } |
| 525 | 523 | ||
| 526 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space, | 524 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space, |
| 527 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift { | 525 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift { |
| 528 | background-position: right top; | 526 | image: url(:/overlay/osk_button_Y.png); |
| 529 | background-repeat: no-repeat; | 527 | image-position: right; |
| 530 | background-origin: content; | ||
| 531 | background-image: url(:/overlay/osk_button_Y.png); | ||
| 532 | } | 528 | } |
| 533 | 529 | ||
| 534 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok, | 530 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok, |
| 535 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift, | 531 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift, |
| 536 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num { | 532 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num { |
| 537 | background-position: right top; | 533 | image: url(:/overlay/osk_button_plus.png); |
| 538 | background-repeat: no-repeat; | 534 | image-position: right; |
| 539 | background-origin: content; | ||
| 540 | background-image: url(:/overlay/osk_button_plus.png); | ||
| 541 | } | 535 | } |
| 542 | 536 | ||
| 543 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift { | 537 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift { |
| 544 | background-position: left top; | 538 | image: url(:/overlay/osk_button_shift_lock_off.png); |
| 545 | background-repeat: no-repeat; | 539 | image-position: left; |
| 546 | background-origin: content; | ||
| 547 | background-image: url(:/overlay/osk_button_shift_lock_off.png); | ||
| 548 | qproperty-icon: url(:/overlay/osk_button_shift.png); | 540 | qproperty-icon: url(:/overlay/osk_button_shift.png); |
| 549 | qproperty-iconSize: 36px; | 541 | qproperty-iconSize: 36px; |
| 550 | } | 542 | } |
| 551 | 543 | ||
| 552 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift_shift { | 544 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift_shift { |
| 553 | background-position: left top; | 545 | image: url(:/overlay/osk_button_shift_lock_off.png); |
| 554 | background-repeat: no-repeat; | 546 | image-position: left; |
| 555 | background-origin: content; | ||
| 556 | background-image: url(:/overlay/osk_button_shift_lock_off.png); | ||
| 557 | qproperty-icon: url(:/overlay/osk_button_shift_on.png); | 547 | qproperty-icon: url(:/overlay/osk_button_shift_on.png); |
| 558 | qproperty-iconSize: 36px; | 548 | qproperty-iconSize: 36px; |
| 559 | } | 549 | } |
| @@ -645,16 +635,16 @@ QDialog#QtSoftwareKeyboardDialog QPushButton#button_return:disabled { | |||
| 645 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok:disabled, | 635 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok:disabled, |
| 646 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift:disabled, | 636 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift:disabled, |
| 647 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num:disabled { | 637 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num:disabled { |
| 648 | background-image: url(:/overlay/osk_button_plus_disabled.png); | 638 | image: url(:/overlay/osk_button_plus_disabled.png); |
| 649 | } | 639 | } |
| 650 | 640 | ||
| 651 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace:disabled, | 641 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace:disabled, |
| 652 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift:disabled, | 642 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift:disabled, |
| 653 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:disabled { | 643 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:disabled { |
| 654 | background-image: url(:/overlay/osk_button_B_disabled.png); | 644 | image: url(:/overlay/osk_button_B_disabled.png); |
| 655 | } | 645 | } |
| 656 | 646 | ||
| 657 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space:disabled, | 647 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space:disabled, |
| 658 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift:disabled { | 648 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift:disabled { |
| 659 | background-image: url(:/overlay/osk_button_Y_disabled.png); | 649 | image: url(:/overlay/osk_button_Y_disabled.png); |
| 660 | } | 650 | } |
diff --git a/dist/qt_themes/qdarkstyle/icons/48x48/star.png b/dist/qt_themes/qdarkstyle/icons/48x48/star.png new file mode 100644 index 000000000..90d423a1d --- /dev/null +++ b/dist/qt_themes/qdarkstyle/icons/48x48/star.png | |||
| Binary files differ | |||
diff --git a/dist/qt_themes/qdarkstyle/style.qrc b/dist/qt_themes/qdarkstyle/style.qrc index 2b91204f3..34e872d25 100644 --- a/dist/qt_themes/qdarkstyle/style.qrc +++ b/dist/qt_themes/qdarkstyle/style.qrc | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | <file alias="48x48/folder.png">icons/48x48/folder.png</file> | 8 | <file alias="48x48/folder.png">icons/48x48/folder.png</file> |
| 9 | <file alias="48x48/plus.png">icons/48x48/plus.png</file> | 9 | <file alias="48x48/plus.png">icons/48x48/plus.png</file> |
| 10 | <file alias="48x48/sd_card.png">icons/48x48/sd_card.png</file> | 10 | <file alias="48x48/sd_card.png">icons/48x48/sd_card.png</file> |
| 11 | <file alias="48x48/star.png">icons/48x48/star.png</file> | ||
| 11 | <file alias="256x256/plus_folder.png">icons/256x256/plus_folder.png</file> | 12 | <file alias="256x256/plus_folder.png">icons/256x256/plus_folder.png</file> |
| 12 | </qresource> | 13 | </qresource> |
| 13 | <qresource prefix="qss_icons"> | 14 | <qresource prefix="qss_icons"> |
diff --git a/dist/qt_themes/qdarkstyle/style.qss b/dist/qt_themes/qdarkstyle/style.qss index 8ce6d75f7..3d0ccbb9e 100644 --- a/dist/qt_themes/qdarkstyle/style.qss +++ b/dist/qt_themes/qdarkstyle/style.qss | |||
| @@ -1805,46 +1805,36 @@ QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:pressed { | |||
| 1805 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace, | 1805 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace, |
| 1806 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift, | 1806 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift, |
| 1807 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num { | 1807 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num { |
| 1808 | background-position: right top; | 1808 | image: url(:/overlay/osk_button_B_dark.png); |
| 1809 | background-repeat: no-repeat; | 1809 | image-position: right; |
| 1810 | background-origin: content; | ||
| 1811 | background-image: url(:/overlay/osk_button_B_dark.png); | ||
| 1812 | qproperty-icon: url(:/overlay/osk_button_backspace_dark.png); | 1810 | qproperty-icon: url(:/overlay/osk_button_backspace_dark.png); |
| 1813 | qproperty-iconSize: 36px; | 1811 | qproperty-iconSize: 36px; |
| 1814 | } | 1812 | } |
| 1815 | 1813 | ||
| 1816 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space, | 1814 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space, |
| 1817 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift { | 1815 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift { |
| 1818 | background-position: right top; | 1816 | image: url(:/overlay/osk_button_Y_dark.png); |
| 1819 | background-repeat: no-repeat; | 1817 | image-position: right; |
| 1820 | background-origin: content; | ||
| 1821 | background-image: url(:/overlay/osk_button_Y_dark.png); | ||
| 1822 | } | 1818 | } |
| 1823 | 1819 | ||
| 1824 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok, | 1820 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok, |
| 1825 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift, | 1821 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift, |
| 1826 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num { | 1822 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num { |
| 1827 | color: rgba(44, 44, 44, 1); | 1823 | color: rgba(44, 44, 44, 1); |
| 1828 | background-position: right top; | 1824 | image: url(:/overlay/osk_button_plus_dark.png); |
| 1829 | background-repeat: no-repeat; | 1825 | image-position: right; |
| 1830 | background-origin: content; | ||
| 1831 | background-image: url(:/overlay/osk_button_plus_dark.png); | ||
| 1832 | } | 1826 | } |
| 1833 | 1827 | ||
| 1834 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift { | 1828 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift { |
| 1835 | background-position: left top; | 1829 | image: url(:/overlay/osk_button_shift_lock_off.png); |
| 1836 | background-repeat: no-repeat; | 1830 | image-position: left; |
| 1837 | background-origin: content; | ||
| 1838 | background-image: url(:/overlay/osk_button_shift_lock_off.png); | ||
| 1839 | qproperty-icon: url(:/overlay/osk_button_shift_dark.png); | 1831 | qproperty-icon: url(:/overlay/osk_button_shift_dark.png); |
| 1840 | qproperty-iconSize: 36px; | 1832 | qproperty-iconSize: 36px; |
| 1841 | } | 1833 | } |
| 1842 | 1834 | ||
| 1843 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift_shift { | 1835 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift_shift { |
| 1844 | background-position: left top; | 1836 | image: url(:/overlay/osk_button_shift_lock_off.png); |
| 1845 | background-repeat: no-repeat; | 1837 | image-position: left; |
| 1846 | background-origin: content; | ||
| 1847 | background-image: url(:/overlay/osk_button_shift_lock_off.png); | ||
| 1848 | qproperty-icon: url(:/overlay/osk_button_shift_on_dark.png); | 1838 | qproperty-icon: url(:/overlay/osk_button_shift_on_dark.png); |
| 1849 | qproperty-iconSize: 36px; | 1839 | qproperty-iconSize: 36px; |
| 1850 | } | 1840 | } |
| @@ -1936,18 +1926,18 @@ QDialog#QtSoftwareKeyboardDialog QPushButton#button_return:disabled { | |||
| 1936 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok:disabled, | 1926 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok:disabled, |
| 1937 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift:disabled, | 1927 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift:disabled, |
| 1938 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num:disabled { | 1928 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num:disabled { |
| 1939 | background-image: url(:/overlay/osk_button_plus_dark_disabled.png); | 1929 | image: url(:/overlay/osk_button_plus_dark_disabled.png); |
| 1940 | } | 1930 | } |
| 1941 | 1931 | ||
| 1942 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace:disabled, | 1932 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace:disabled, |
| 1943 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift:disabled, | 1933 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift:disabled, |
| 1944 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:disabled { | 1934 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:disabled { |
| 1945 | background-image: url(:/overlay/osk_button_B_dark_disabled.png); | 1935 | image: url(:/overlay/osk_button_B_dark_disabled.png); |
| 1946 | } | 1936 | } |
| 1947 | 1937 | ||
| 1948 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space:disabled, | 1938 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space:disabled, |
| 1949 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift:disabled { | 1939 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift:disabled { |
| 1950 | background-image: url(:/overlay/osk_button_Y_dark_disabled.png); | 1940 | image: url(:/overlay/osk_button_Y_dark_disabled.png); |
| 1951 | } | 1941 | } |
| 1952 | 1942 | ||
| 1953 | QDialog#QtSoftwareKeyboardDialog QFrame, | 1943 | QDialog#QtSoftwareKeyboardDialog QFrame, |
diff --git a/dist/qt_themes/qdarkstyle_midnight_blue/icons/48x48/star.png b/dist/qt_themes/qdarkstyle_midnight_blue/icons/48x48/star.png new file mode 100644 index 000000000..90d423a1d --- /dev/null +++ b/dist/qt_themes/qdarkstyle_midnight_blue/icons/48x48/star.png | |||
| Binary files differ | |||
diff --git a/dist/qt_themes/qdarkstyle_midnight_blue/style.qrc b/dist/qt_themes/qdarkstyle_midnight_blue/style.qrc index 579e73ece..142dd3288 100644 --- a/dist/qt_themes/qdarkstyle_midnight_blue/style.qrc +++ b/dist/qt_themes/qdarkstyle_midnight_blue/style.qrc | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | <file alias="48x48/folder.png">icons/48x48/folder.png</file> | 8 | <file alias="48x48/folder.png">icons/48x48/folder.png</file> |
| 9 | <file alias="48x48/plus.png">icons/48x48/plus.png</file> | 9 | <file alias="48x48/plus.png">icons/48x48/plus.png</file> |
| 10 | <file alias="48x48/sd_card.png">icons/48x48/sd_card.png</file> | 10 | <file alias="48x48/sd_card.png">icons/48x48/sd_card.png</file> |
| 11 | <file alias="48x48/star.png">icons/48x48/star.png</file> | ||
| 11 | <file alias="256x256/plus_folder.png">icons/256x256/plus_folder.png</file> | 12 | <file alias="256x256/plus_folder.png">icons/256x256/plus_folder.png</file> |
| 12 | </qresource> | 13 | </qresource> |
| 13 | <qresource prefix="qss_icons"> | 14 | <qresource prefix="qss_icons"> |
diff --git a/dist/qt_themes/qdarkstyle_midnight_blue/style.qss b/dist/qt_themes/qdarkstyle_midnight_blue/style.qss index 64e1ecbcc..51bec2fd7 100644 --- a/dist/qt_themes/qdarkstyle_midnight_blue/style.qss +++ b/dist/qt_themes/qdarkstyle_midnight_blue/style.qss | |||
| @@ -2740,46 +2740,36 @@ QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:pressed { | |||
| 2740 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace, | 2740 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace, |
| 2741 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift, | 2741 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift, |
| 2742 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num { | 2742 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num { |
| 2743 | background-position: right top; | 2743 | image: url(:/overlay/osk_button_B_dark.png); |
| 2744 | background-repeat: no-repeat; | 2744 | image-position: right; |
| 2745 | background-origin: content; | ||
| 2746 | background-image: url(:/overlay/osk_button_B_dark.png); | ||
| 2747 | qproperty-icon: url(:/overlay/osk_button_backspace_dark.png); | 2745 | qproperty-icon: url(:/overlay/osk_button_backspace_dark.png); |
| 2748 | qproperty-iconSize: 36px; | 2746 | qproperty-iconSize: 36px; |
| 2749 | } | 2747 | } |
| 2750 | 2748 | ||
| 2751 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space, | 2749 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space, |
| 2752 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift { | 2750 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift { |
| 2753 | background-position: right top; | 2751 | image: url(:/overlay/osk_button_Y_dark.png); |
| 2754 | background-repeat: no-repeat; | 2752 | image-position: right; |
| 2755 | background-origin: content; | ||
| 2756 | background-image: url(:/overlay/osk_button_Y_dark.png); | ||
| 2757 | } | 2753 | } |
| 2758 | 2754 | ||
| 2759 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok, | 2755 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok, |
| 2760 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift, | 2756 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift, |
| 2761 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num { | 2757 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num { |
| 2762 | color: rgba(44, 44, 44, 1); | 2758 | color: rgba(44, 44, 44, 1); |
| 2763 | background-position: right top; | 2759 | image: url(:/overlay/osk_button_plus_dark.png); |
| 2764 | background-repeat: no-repeat; | 2760 | image-position: right; |
| 2765 | background-origin: content; | ||
| 2766 | background-image: url(:/overlay/osk_button_plus_dark.png); | ||
| 2767 | } | 2761 | } |
| 2768 | 2762 | ||
| 2769 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift { | 2763 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift { |
| 2770 | background-position: left top; | 2764 | image: url(:/overlay/osk_button_shift_lock_off.png); |
| 2771 | background-repeat: no-repeat; | 2765 | image-position: left; |
| 2772 | background-origin: content; | ||
| 2773 | background-image: url(:/overlay/osk_button_shift_lock_off.png); | ||
| 2774 | qproperty-icon: url(:/overlay/osk_button_shift_dark.png); | 2766 | qproperty-icon: url(:/overlay/osk_button_shift_dark.png); |
| 2775 | qproperty-iconSize: 36px; | 2767 | qproperty-iconSize: 36px; |
| 2776 | } | 2768 | } |
| 2777 | 2769 | ||
| 2778 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift_shift { | 2770 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift_shift { |
| 2779 | background-position: left top; | 2771 | image: url(:/overlay/osk_button_shift_lock_off.png); |
| 2780 | background-repeat: no-repeat; | 2772 | image-position: left; |
| 2781 | background-origin: content; | ||
| 2782 | background-image: url(:/overlay/osk_button_shift_lock_off.png); | ||
| 2783 | qproperty-icon: url(:/overlay/osk_button_shift_on_dark.png); | 2773 | qproperty-icon: url(:/overlay/osk_button_shift_on_dark.png); |
| 2784 | qproperty-iconSize: 36px; | 2774 | qproperty-iconSize: 36px; |
| 2785 | } | 2775 | } |
| @@ -2871,16 +2861,16 @@ QDialog#QtSoftwareKeyboardDialog QPushButton#button_return:disabled { | |||
| 2871 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok:disabled, | 2861 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok:disabled, |
| 2872 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift:disabled, | 2862 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift:disabled, |
| 2873 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num:disabled { | 2863 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num:disabled { |
| 2874 | background-image: url(:/overlay/osk_button_plus_dark_disabled.png); | 2864 | image: url(:/overlay/osk_button_plus_dark_disabled.png); |
| 2875 | } | 2865 | } |
| 2876 | 2866 | ||
| 2877 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace:disabled, | 2867 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace:disabled, |
| 2878 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift:disabled, | 2868 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift:disabled, |
| 2879 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:disabled { | 2869 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:disabled { |
| 2880 | background-image: url(:/overlay/osk_button_B_dark_disabled.png); | 2870 | image: url(:/overlay/osk_button_B_dark_disabled.png); |
| 2881 | } | 2871 | } |
| 2882 | 2872 | ||
| 2883 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space:disabled, | 2873 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space:disabled, |
| 2884 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift:disabled { | 2874 | QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift:disabled { |
| 2885 | background-image: url(:/overlay/osk_button_Y_dark_disabled.png); | 2875 | image: url(:/overlay/osk_button_Y_dark_disabled.png); |
| 2886 | } | 2876 | } |
diff --git a/license.txt b/license.txt index 86e7b3c1b..495f3e676 100644 --- a/license.txt +++ b/license.txt | |||
| @@ -358,6 +358,7 @@ chip.png (Colorful, Colorful Dark) | CC BY-ND 3.0 | https://icons8.com | |||
| 358 | folder.png (Colorful, Colorful Dark) | CC BY-ND 3.0 | https://icons8.com | 358 | folder.png (Colorful, Colorful Dark) | CC BY-ND 3.0 | https://icons8.com |
| 359 | plus.png (Colorful, Colorful Dark) | CC BY-ND 3.0 | https://icons8.com | 359 | plus.png (Colorful, Colorful Dark) | CC BY-ND 3.0 | https://icons8.com |
| 360 | sd_card.png (Colorful, Colorful Dark) | CC BY-ND 3.0 | https://icons8.com | 360 | sd_card.png (Colorful, Colorful Dark) | CC BY-ND 3.0 | https://icons8.com |
| 361 | star.png | CC BY-ND 3.0 | https://icons8.com | ||
| 361 | 362 | ||
| 362 | Note: | 363 | Note: |
| 363 | Some icons are different in different themes, and they are separately listed | 364 | Some icons are different in different themes, and they are separately listed |
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 2ed87d3e9..c28abc24c 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -377,6 +377,8 @@ add_library(core STATIC | |||
| 377 | hle/service/glue/arp.h | 377 | hle/service/glue/arp.h |
| 378 | hle/service/glue/bgtc.cpp | 378 | hle/service/glue/bgtc.cpp |
| 379 | hle/service/glue/bgtc.h | 379 | hle/service/glue/bgtc.h |
| 380 | hle/service/glue/ectx.cpp | ||
| 381 | hle/service/glue/ectx.h | ||
| 380 | hle/service/glue/errors.h | 382 | hle/service/glue/errors.h |
| 381 | hle/service/glue/glue.cpp | 383 | hle/service/glue/glue.cpp |
| 382 | hle/service/glue/glue.h | 384 | hle/service/glue/glue.h |
diff --git a/src/core/crypto/aes_util.cpp b/src/core/crypto/aes_util.cpp index cb7506241..85a666de9 100644 --- a/src/core/crypto/aes_util.cpp +++ b/src/core/crypto/aes_util.cpp | |||
| @@ -119,9 +119,9 @@ void AESCipher<Key, KeySize>::XTSTranscode(const u8* src, std::size_t size, u8* | |||
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | template <typename Key, std::size_t KeySize> | 121 | template <typename Key, std::size_t KeySize> |
| 122 | void AESCipher<Key, KeySize>::SetIVImpl(const u8* data, std::size_t size) { | 122 | void AESCipher<Key, KeySize>::SetIV(std::span<const u8> data) { |
| 123 | ASSERT_MSG((mbedtls_cipher_set_iv(&ctx->encryption_context, data, size) || | 123 | ASSERT_MSG((mbedtls_cipher_set_iv(&ctx->encryption_context, data.data(), data.size()) || |
| 124 | mbedtls_cipher_set_iv(&ctx->decryption_context, data, size)) == 0, | 124 | mbedtls_cipher_set_iv(&ctx->decryption_context, data.data(), data.size())) == 0, |
| 125 | "Failed to set IV on mbedtls ciphers."); | 125 | "Failed to set IV on mbedtls ciphers."); |
| 126 | } | 126 | } |
| 127 | 127 | ||
diff --git a/src/core/crypto/aes_util.h b/src/core/crypto/aes_util.h index e2a304186..230451b8f 100644 --- a/src/core/crypto/aes_util.h +++ b/src/core/crypto/aes_util.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | #include <span> | ||
| 8 | #include <type_traits> | 9 | #include <type_traits> |
| 9 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 10 | #include "core/file_sys/vfs.h" | 11 | #include "core/file_sys/vfs.h" |
| @@ -33,10 +34,7 @@ public: | |||
| 33 | AESCipher(Key key, Mode mode); | 34 | AESCipher(Key key, Mode mode); |
| 34 | ~AESCipher(); | 35 | ~AESCipher(); |
| 35 | 36 | ||
| 36 | template <typename ContiguousContainer> | 37 | void SetIV(std::span<const u8> data); |
| 37 | void SetIV(const ContiguousContainer& container) { | ||
| 38 | SetIVImpl(std::data(container), std::size(container)); | ||
| 39 | } | ||
| 40 | 38 | ||
| 41 | template <typename Source, typename Dest> | 39 | template <typename Source, typename Dest> |
| 42 | void Transcode(const Source* src, std::size_t size, Dest* dest, Op op) const { | 40 | void Transcode(const Source* src, std::size_t size, Dest* dest, Op op) const { |
| @@ -60,8 +58,6 @@ public: | |||
| 60 | std::size_t sector_size, Op op); | 58 | std::size_t sector_size, Op op); |
| 61 | 59 | ||
| 62 | private: | 60 | private: |
| 63 | void SetIVImpl(const u8* data, std::size_t size); | ||
| 64 | |||
| 65 | std::unique_ptr<CipherContext> ctx; | 61 | std::unique_ptr<CipherContext> ctx; |
| 66 | }; | 62 | }; |
| 67 | } // namespace Core::Crypto | 63 | } // namespace Core::Crypto |
diff --git a/src/core/file_sys/program_metadata.cpp b/src/core/file_sys/program_metadata.cpp index 9cf49bf44..83b83a044 100644 --- a/src/core/file_sys/program_metadata.cpp +++ b/src/core/file_sys/program_metadata.cpp | |||
| @@ -58,7 +58,8 @@ Loader::ResultStatus ProgramMetadata::Load(VirtualFile file) { | |||
| 58 | result.LoadManual( | 58 | result.LoadManual( |
| 59 | true /*is_64_bit*/, FileSys::ProgramAddressSpaceType::Is39Bit /*address_space*/, | 59 | true /*is_64_bit*/, FileSys::ProgramAddressSpaceType::Is39Bit /*address_space*/, |
| 60 | 0x2c /*main_thread_prio*/, 0 /*main_thread_core*/, 0x00100000 /*main_thread_stack_size*/, | 60 | 0x2c /*main_thread_prio*/, 0 /*main_thread_core*/, 0x00100000 /*main_thread_stack_size*/, |
| 61 | {}, 0xFFFFFFFFFFFFFFFF /*filesystem_permissions*/, {} /*capabilities*/); | 61 | 0 /*title_id*/, 0xFFFFFFFFFFFFFFFF /*filesystem_permissions*/, |
| 62 | 0x1FE00000 /*system_resource_size*/, {} /*capabilities*/); | ||
| 62 | 63 | ||
| 63 | return result; | 64 | return result; |
| 64 | } | 65 | } |
| @@ -66,7 +67,7 @@ Loader::ResultStatus ProgramMetadata::Load(VirtualFile file) { | |||
| 66 | void ProgramMetadata::LoadManual(bool is_64_bit, ProgramAddressSpaceType address_space, | 67 | void ProgramMetadata::LoadManual(bool is_64_bit, ProgramAddressSpaceType address_space, |
| 67 | s32 main_thread_prio, u32 main_thread_core, | 68 | s32 main_thread_prio, u32 main_thread_core, |
| 68 | u32 main_thread_stack_size, u64 title_id, | 69 | u32 main_thread_stack_size, u64 title_id, |
| 69 | u64 filesystem_permissions, | 70 | u64 filesystem_permissions, u32 system_resource_size, |
| 70 | KernelCapabilityDescriptors capabilities) { | 71 | KernelCapabilityDescriptors capabilities) { |
| 71 | npdm_header.has_64_bit_instructions.Assign(is_64_bit); | 72 | npdm_header.has_64_bit_instructions.Assign(is_64_bit); |
| 72 | npdm_header.address_space_type.Assign(address_space); | 73 | npdm_header.address_space_type.Assign(address_space); |
| @@ -75,6 +76,7 @@ void ProgramMetadata::LoadManual(bool is_64_bit, ProgramAddressSpaceType address | |||
| 75 | npdm_header.main_stack_size = main_thread_stack_size; | 76 | npdm_header.main_stack_size = main_thread_stack_size; |
| 76 | aci_header.title_id = title_id; | 77 | aci_header.title_id = title_id; |
| 77 | aci_file_access.permissions = filesystem_permissions; | 78 | aci_file_access.permissions = filesystem_permissions; |
| 79 | npdm_header.system_resource_size = system_resource_size; | ||
| 78 | aci_kernel_capabilities = std ::move(capabilities); | 80 | aci_kernel_capabilities = std ::move(capabilities); |
| 79 | } | 81 | } |
| 80 | 82 | ||
diff --git a/src/core/file_sys/program_metadata.h b/src/core/file_sys/program_metadata.h index 455532567..1eee916be 100644 --- a/src/core/file_sys/program_metadata.h +++ b/src/core/file_sys/program_metadata.h | |||
| @@ -44,6 +44,12 @@ public: | |||
| 44 | ProgramMetadata(); | 44 | ProgramMetadata(); |
| 45 | ~ProgramMetadata(); | 45 | ~ProgramMetadata(); |
| 46 | 46 | ||
| 47 | ProgramMetadata(const ProgramMetadata&) = default; | ||
| 48 | ProgramMetadata& operator=(const ProgramMetadata&) = default; | ||
| 49 | |||
| 50 | ProgramMetadata(ProgramMetadata&&) = default; | ||
| 51 | ProgramMetadata& operator=(ProgramMetadata&&) = default; | ||
| 52 | |||
| 47 | /// Gets a default ProgramMetadata configuration, should only be used for homebrew formats where | 53 | /// Gets a default ProgramMetadata configuration, should only be used for homebrew formats where |
| 48 | /// we do not have an NPDM file | 54 | /// we do not have an NPDM file |
| 49 | static ProgramMetadata GetDefault(); | 55 | static ProgramMetadata GetDefault(); |
| @@ -53,7 +59,8 @@ public: | |||
| 53 | /// Load from parameters instead of NPDM file, used for KIP | 59 | /// Load from parameters instead of NPDM file, used for KIP |
| 54 | void LoadManual(bool is_64_bit, ProgramAddressSpaceType address_space, s32 main_thread_prio, | 60 | void LoadManual(bool is_64_bit, ProgramAddressSpaceType address_space, s32 main_thread_prio, |
| 55 | u32 main_thread_core, u32 main_thread_stack_size, u64 title_id, | 61 | u32 main_thread_core, u32 main_thread_stack_size, u64 title_id, |
| 56 | u64 filesystem_permissions, KernelCapabilityDescriptors capabilities); | 62 | u64 filesystem_permissions, u32 system_resource_size, |
| 63 | KernelCapabilityDescriptors capabilities); | ||
| 57 | 64 | ||
| 58 | bool Is64BitProgram() const; | 65 | bool Is64BitProgram() const; |
| 59 | ProgramAddressSpaceType GetAddressSpaceType() const; | 66 | ProgramAddressSpaceType GetAddressSpaceType() const; |
diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp index 474de9206..cff49899a 100644 --- a/src/core/frontend/emu_window.cpp +++ b/src/core/frontend/emu_window.cpp | |||
| @@ -60,23 +60,23 @@ EmuWindow::~EmuWindow() { | |||
| 60 | * @param framebuffer_y Framebuffer y-coordinate to check | 60 | * @param framebuffer_y Framebuffer y-coordinate to check |
| 61 | * @return True if the coordinates are within the touchpad, otherwise false | 61 | * @return True if the coordinates are within the touchpad, otherwise false |
| 62 | */ | 62 | */ |
| 63 | static bool IsWithinTouchscreen(const Layout::FramebufferLayout& layout, unsigned framebuffer_x, | 63 | static bool IsWithinTouchscreen(const Layout::FramebufferLayout& layout, u32 framebuffer_x, |
| 64 | unsigned framebuffer_y) { | 64 | u32 framebuffer_y) { |
| 65 | return (framebuffer_y >= layout.screen.top && framebuffer_y < layout.screen.bottom && | 65 | return (framebuffer_y >= layout.screen.top && framebuffer_y < layout.screen.bottom && |
| 66 | framebuffer_x >= layout.screen.left && framebuffer_x < layout.screen.right); | 66 | framebuffer_x >= layout.screen.left && framebuffer_x < layout.screen.right); |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | std::tuple<unsigned, unsigned> EmuWindow::ClipToTouchScreen(unsigned new_x, unsigned new_y) const { | 69 | std::pair<u32, u32> EmuWindow::ClipToTouchScreen(u32 new_x, u32 new_y) const { |
| 70 | new_x = std::max(new_x, framebuffer_layout.screen.left); | 70 | new_x = std::max(new_x, framebuffer_layout.screen.left); |
| 71 | new_x = std::min(new_x, framebuffer_layout.screen.right - 1); | 71 | new_x = std::min(new_x, framebuffer_layout.screen.right - 1); |
| 72 | 72 | ||
| 73 | new_y = std::max(new_y, framebuffer_layout.screen.top); | 73 | new_y = std::max(new_y, framebuffer_layout.screen.top); |
| 74 | new_y = std::min(new_y, framebuffer_layout.screen.bottom - 1); | 74 | new_y = std::min(new_y, framebuffer_layout.screen.bottom - 1); |
| 75 | 75 | ||
| 76 | return std::make_tuple(new_x, new_y); | 76 | return std::make_pair(new_x, new_y); |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | void EmuWindow::TouchPressed(unsigned framebuffer_x, unsigned framebuffer_y, std::size_t id) { | 79 | void EmuWindow::TouchPressed(u32 framebuffer_x, u32 framebuffer_y, size_t id) { |
| 80 | if (!IsWithinTouchscreen(framebuffer_layout, framebuffer_x, framebuffer_y)) { | 80 | if (!IsWithinTouchscreen(framebuffer_layout, framebuffer_x, framebuffer_y)) { |
| 81 | return; | 81 | return; |
| 82 | } | 82 | } |
| @@ -95,7 +95,7 @@ void EmuWindow::TouchPressed(unsigned framebuffer_x, unsigned framebuffer_y, std | |||
| 95 | touch_state->status[id] = std::make_tuple(x, y, true); | 95 | touch_state->status[id] = std::make_tuple(x, y, true); |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | void EmuWindow::TouchReleased(std::size_t id) { | 98 | void EmuWindow::TouchReleased(size_t id) { |
| 99 | if (id >= touch_state->status.size()) { | 99 | if (id >= touch_state->status.size()) { |
| 100 | return; | 100 | return; |
| 101 | } | 101 | } |
| @@ -103,20 +103,23 @@ void EmuWindow::TouchReleased(std::size_t id) { | |||
| 103 | touch_state->status[id] = std::make_tuple(0.0f, 0.0f, false); | 103 | touch_state->status[id] = std::make_tuple(0.0f, 0.0f, false); |
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | void EmuWindow::TouchMoved(unsigned framebuffer_x, unsigned framebuffer_y, std::size_t id) { | 106 | void EmuWindow::TouchMoved(u32 framebuffer_x, u32 framebuffer_y, size_t id) { |
| 107 | if (id >= touch_state->status.size()) { | 107 | if (id >= touch_state->status.size()) { |
| 108 | return; | 108 | return; |
| 109 | } | 109 | } |
| 110 | if (!std::get<2>(touch_state->status[id])) | 110 | |
| 111 | if (!std::get<2>(touch_state->status[id])) { | ||
| 111 | return; | 112 | return; |
| 113 | } | ||
| 112 | 114 | ||
| 113 | if (!IsWithinTouchscreen(framebuffer_layout, framebuffer_x, framebuffer_y)) | 115 | if (!IsWithinTouchscreen(framebuffer_layout, framebuffer_x, framebuffer_y)) { |
| 114 | std::tie(framebuffer_x, framebuffer_y) = ClipToTouchScreen(framebuffer_x, framebuffer_y); | 116 | std::tie(framebuffer_x, framebuffer_y) = ClipToTouchScreen(framebuffer_x, framebuffer_y); |
| 117 | } | ||
| 115 | 118 | ||
| 116 | TouchPressed(framebuffer_x, framebuffer_y, id); | 119 | TouchPressed(framebuffer_x, framebuffer_y, id); |
| 117 | } | 120 | } |
| 118 | 121 | ||
| 119 | void EmuWindow::UpdateCurrentFramebufferLayout(unsigned width, unsigned height) { | 122 | void EmuWindow::UpdateCurrentFramebufferLayout(u32 width, u32 height) { |
| 120 | NotifyFramebufferLayoutChanged(Layout::DefaultFrameLayout(width, height)); | 123 | NotifyFramebufferLayoutChanged(Layout::DefaultFrameLayout(width, height)); |
| 121 | } | 124 | } |
| 122 | 125 | ||
diff --git a/src/core/frontend/emu_window.h b/src/core/frontend/emu_window.h index 2436c6580..076148698 100644 --- a/src/core/frontend/emu_window.h +++ b/src/core/frontend/emu_window.h | |||
| @@ -82,7 +82,7 @@ public: | |||
| 82 | bool fullscreen = false; | 82 | bool fullscreen = false; |
| 83 | int res_width = 0; | 83 | int res_width = 0; |
| 84 | int res_height = 0; | 84 | int res_height = 0; |
| 85 | std::pair<unsigned, unsigned> min_client_area_size; | 85 | std::pair<u32, u32> min_client_area_size; |
| 86 | }; | 86 | }; |
| 87 | 87 | ||
| 88 | /// Data describing host window system information | 88 | /// Data describing host window system information |
| @@ -119,13 +119,13 @@ public: | |||
| 119 | * @param framebuffer_y Framebuffer y-coordinate that was pressed | 119 | * @param framebuffer_y Framebuffer y-coordinate that was pressed |
| 120 | * @param id Touch event ID | 120 | * @param id Touch event ID |
| 121 | */ | 121 | */ |
| 122 | void TouchPressed(unsigned framebuffer_x, unsigned framebuffer_y, std::size_t id); | 122 | void TouchPressed(u32 framebuffer_x, u32 framebuffer_y, size_t id); |
| 123 | 123 | ||
| 124 | /** | 124 | /** |
| 125 | * Signal that a touch released event has occurred (e.g. mouse click released) | 125 | * Signal that a touch released event has occurred (e.g. mouse click released) |
| 126 | * @param id Touch event ID | 126 | * @param id Touch event ID |
| 127 | */ | 127 | */ |
| 128 | void TouchReleased(std::size_t id); | 128 | void TouchReleased(size_t id); |
| 129 | 129 | ||
| 130 | /** | 130 | /** |
| 131 | * Signal that a touch movement event has occurred (e.g. mouse was moved over the emu window) | 131 | * Signal that a touch movement event has occurred (e.g. mouse was moved over the emu window) |
| @@ -133,7 +133,7 @@ public: | |||
| 133 | * @param framebuffer_y Framebuffer y-coordinate | 133 | * @param framebuffer_y Framebuffer y-coordinate |
| 134 | * @param id Touch event ID | 134 | * @param id Touch event ID |
| 135 | */ | 135 | */ |
| 136 | void TouchMoved(unsigned framebuffer_x, unsigned framebuffer_y, std::size_t id); | 136 | void TouchMoved(u32 framebuffer_x, u32 framebuffer_y, size_t id); |
| 137 | 137 | ||
| 138 | /** | 138 | /** |
| 139 | * Returns currently active configuration. | 139 | * Returns currently active configuration. |
| @@ -173,7 +173,7 @@ public: | |||
| 173 | * Convenience method to update the current frame layout | 173 | * Convenience method to update the current frame layout |
| 174 | * Read from the current settings to determine which layout to use. | 174 | * Read from the current settings to determine which layout to use. |
| 175 | */ | 175 | */ |
| 176 | void UpdateCurrentFramebufferLayout(unsigned width, unsigned height); | 176 | void UpdateCurrentFramebufferLayout(u32 width, u32 height); |
| 177 | 177 | ||
| 178 | protected: | 178 | protected: |
| 179 | explicit EmuWindow(); | 179 | explicit EmuWindow(); |
| @@ -208,7 +208,7 @@ protected: | |||
| 208 | * Update internal client area size with the given parameter. | 208 | * Update internal client area size with the given parameter. |
| 209 | * @note EmuWindow implementations will usually use this in window resize event handlers. | 209 | * @note EmuWindow implementations will usually use this in window resize event handlers. |
| 210 | */ | 210 | */ |
| 211 | void NotifyClientAreaSizeChanged(const std::pair<unsigned, unsigned>& size) { | 211 | void NotifyClientAreaSizeChanged(std::pair<u32, u32> size) { |
| 212 | client_area_width = size.first; | 212 | client_area_width = size.first; |
| 213 | client_area_height = size.second; | 213 | client_area_height = size.second; |
| 214 | } | 214 | } |
| @@ -221,14 +221,19 @@ private: | |||
| 221 | * For the request to be honored, EmuWindow implementations will usually reimplement this | 221 | * For the request to be honored, EmuWindow implementations will usually reimplement this |
| 222 | * function. | 222 | * function. |
| 223 | */ | 223 | */ |
| 224 | virtual void OnMinimalClientAreaChangeRequest(std::pair<unsigned, unsigned>) { | 224 | virtual void OnMinimalClientAreaChangeRequest(std::pair<u32, u32>) { |
| 225 | // By default, ignore this request and do nothing. | 225 | // By default, ignore this request and do nothing. |
| 226 | } | 226 | } |
| 227 | 227 | ||
| 228 | /** | ||
| 229 | * Clip the provided coordinates to be inside the touchscreen area. | ||
| 230 | */ | ||
| 231 | std::pair<u32, u32> ClipToTouchScreen(u32 new_x, u32 new_y) const; | ||
| 232 | |||
| 228 | Layout::FramebufferLayout framebuffer_layout; ///< Current framebuffer layout | 233 | Layout::FramebufferLayout framebuffer_layout; ///< Current framebuffer layout |
| 229 | 234 | ||
| 230 | unsigned client_area_width; ///< Current client width, should be set by window impl. | 235 | u32 client_area_width; ///< Current client width, should be set by window impl. |
| 231 | unsigned client_area_height; ///< Current client height, should be set by window impl. | 236 | u32 client_area_height; ///< Current client height, should be set by window impl. |
| 232 | 237 | ||
| 233 | WindowConfig config; ///< Internal configuration (changes pending for being applied in | 238 | WindowConfig config; ///< Internal configuration (changes pending for being applied in |
| 234 | /// ProcessConfigurationChanges) | 239 | /// ProcessConfigurationChanges) |
| @@ -236,11 +241,6 @@ private: | |||
| 236 | 241 | ||
| 237 | class TouchState; | 242 | class TouchState; |
| 238 | std::shared_ptr<TouchState> touch_state; | 243 | std::shared_ptr<TouchState> touch_state; |
| 239 | |||
| 240 | /** | ||
| 241 | * Clip the provided coordinates to be inside the touchscreen area. | ||
| 242 | */ | ||
| 243 | std::tuple<unsigned, unsigned> ClipToTouchScreen(unsigned new_x, unsigned new_y) const; | ||
| 244 | }; | 244 | }; |
| 245 | 245 | ||
| 246 | } // namespace Core::Frontend | 246 | } // namespace Core::Frontend |
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index 52535ecc0..5450dcf0f 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp | |||
| @@ -702,16 +702,12 @@ void Module::Interface::IsUserRegistrationRequestPermitted(Kernel::HLERequestCon | |||
| 702 | } | 702 | } |
| 703 | 703 | ||
| 704 | void Module::Interface::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) { | 704 | void Module::Interface::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) { |
| 705 | IPC::RequestParser rp{ctx}; | ||
| 706 | |||
| 707 | LOG_DEBUG(Service_ACC, "called"); | 705 | LOG_DEBUG(Service_ACC, "called"); |
| 708 | IPC::ResponseBuilder rb{ctx, 2}; | 706 | IPC::ResponseBuilder rb{ctx, 2}; |
| 709 | rb.Push(InitializeApplicationInfoBase()); | 707 | rb.Push(InitializeApplicationInfoBase()); |
| 710 | } | 708 | } |
| 711 | 709 | ||
| 712 | void Module::Interface::InitializeApplicationInfoRestricted(Kernel::HLERequestContext& ctx) { | 710 | void Module::Interface::InitializeApplicationInfoRestricted(Kernel::HLERequestContext& ctx) { |
| 713 | IPC::RequestParser rp{ctx}; | ||
| 714 | |||
| 715 | LOG_WARNING(Service_ACC, "(Partial implementation) called"); | 711 | LOG_WARNING(Service_ACC, "(Partial implementation) called"); |
| 716 | 712 | ||
| 717 | // TODO(ogniK): We require checking if the user actually owns the title and what not. As of | 713 | // TODO(ogniK): We require checking if the user actually owns the title and what not. As of |
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 4c8216b47..58c7f2930 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -687,7 +687,7 @@ ICommonStateGetter::ICommonStateGetter(Core::System& system_, | |||
| 687 | {501, nullptr, "SuppressDisablingSleepTemporarily"}, | 687 | {501, nullptr, "SuppressDisablingSleepTemporarily"}, |
| 688 | {502, nullptr, "IsSleepEnabled"}, | 688 | {502, nullptr, "IsSleepEnabled"}, |
| 689 | {503, nullptr, "IsDisablingSleepSuppressed"}, | 689 | {503, nullptr, "IsDisablingSleepSuppressed"}, |
| 690 | {900, nullptr, "SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled"}, | 690 | {900, &ICommonStateGetter::SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled, "SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled"}, |
| 691 | }; | 691 | }; |
| 692 | // clang-format on | 692 | // clang-format on |
| 693 | 693 | ||
| @@ -817,6 +817,14 @@ void ICommonStateGetter::SetCpuBoostMode(Kernel::HLERequestContext& ctx) { | |||
| 817 | apm_sys->SetCpuBoostMode(ctx); | 817 | apm_sys->SetCpuBoostMode(ctx); |
| 818 | } | 818 | } |
| 819 | 819 | ||
| 820 | void ICommonStateGetter::SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled( | ||
| 821 | Kernel::HLERequestContext& ctx) { | ||
| 822 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 823 | |||
| 824 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 825 | rb.Push(RESULT_SUCCESS); | ||
| 826 | } | ||
| 827 | |||
| 820 | IStorageImpl::~IStorageImpl() = default; | 828 | IStorageImpl::~IStorageImpl() = default; |
| 821 | 829 | ||
| 822 | class StorageDataImpl final : public IStorageImpl { | 830 | class StorageDataImpl final : public IStorageImpl { |
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index 756434716..5d302e155 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h | |||
| @@ -196,6 +196,7 @@ private: | |||
| 196 | void EndVrModeEx(Kernel::HLERequestContext& ctx); | 196 | void EndVrModeEx(Kernel::HLERequestContext& ctx); |
| 197 | void GetDefaultDisplayResolution(Kernel::HLERequestContext& ctx); | 197 | void GetDefaultDisplayResolution(Kernel::HLERequestContext& ctx); |
| 198 | void SetCpuBoostMode(Kernel::HLERequestContext& ctx); | 198 | void SetCpuBoostMode(Kernel::HLERequestContext& ctx); |
| 199 | void SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled(Kernel::HLERequestContext& ctx); | ||
| 199 | 200 | ||
| 200 | std::shared_ptr<AppletMessageQueue> msg_queue; | 201 | std::shared_ptr<AppletMessageQueue> msg_queue; |
| 201 | bool vr_mode_state{}; | 202 | bool vr_mode_state{}; |
diff --git a/src/core/hle/service/am/applets/error.cpp b/src/core/hle/service/am/applets/error.cpp index 23e30aa45..0dd6ec68e 100644 --- a/src/core/hle/service/am/applets/error.cpp +++ b/src/core/hle/service/am/applets/error.cpp | |||
| @@ -158,11 +158,11 @@ void Error::Execute() { | |||
| 158 | break; | 158 | break; |
| 159 | case ErrorAppletMode::ShowSystemError: | 159 | case ErrorAppletMode::ShowSystemError: |
| 160 | case ErrorAppletMode::ShowApplicationError: { | 160 | case ErrorAppletMode::ShowApplicationError: { |
| 161 | const auto system = mode == ErrorAppletMode::ShowSystemError; | 161 | const auto is_system = mode == ErrorAppletMode::ShowSystemError; |
| 162 | const auto& main_text = | 162 | const auto& main_text = |
| 163 | system ? args->system_error.main_text : args->application_error.main_text; | 163 | is_system ? args->system_error.main_text : args->application_error.main_text; |
| 164 | const auto& detail_text = | 164 | const auto& detail_text = |
| 165 | system ? args->system_error.detail_text : args->application_error.detail_text; | 165 | is_system ? args->system_error.detail_text : args->application_error.detail_text; |
| 166 | 166 | ||
| 167 | const auto main_text_string = | 167 | const auto main_text_string = |
| 168 | Common::StringFromFixedZeroTerminatedBuffer(main_text.data(), main_text.size()); | 168 | Common::StringFromFixedZeroTerminatedBuffer(main_text.data(), main_text.size()); |
diff --git a/src/core/hle/service/am/applets/general_backend.cpp b/src/core/hle/service/am/applets/general_backend.cpp index b26abad36..b7483261e 100644 --- a/src/core/hle/service/am/applets/general_backend.cpp +++ b/src/core/hle/service/am/applets/general_backend.cpp | |||
| @@ -96,7 +96,7 @@ void Auth::Execute() { | |||
| 96 | 96 | ||
| 97 | switch (type) { | 97 | switch (type) { |
| 98 | case AuthAppletType::ShowParentalAuthentication: { | 98 | case AuthAppletType::ShowParentalAuthentication: { |
| 99 | const auto callback = [this](bool successful) { AuthFinished(successful); }; | 99 | const auto callback = [this](bool is_successful) { AuthFinished(is_successful); }; |
| 100 | 100 | ||
| 101 | if (arg0 == 1 && arg1 == 0 && arg2 == 1) { | 101 | if (arg0 == 1 && arg1 == 0 && arg2 == 1) { |
| 102 | // ShowAuthenticatorForConfiguration | 102 | // ShowAuthenticatorForConfiguration |
diff --git a/src/core/hle/service/bcat/backend/boxcat.cpp b/src/core/hle/service/bcat/backend/boxcat.cpp index 78c047bd2..cee1774d1 100644 --- a/src/core/hle/service/bcat/backend/boxcat.cpp +++ b/src/core/hle/service/bcat/backend/boxcat.cpp | |||
| @@ -415,9 +415,9 @@ std::optional<std::vector<u8>> Boxcat::GetLaunchParameter(TitleIDVersion title) | |||
| 415 | if (Settings::values.bcat_boxcat_local) { | 415 | if (Settings::values.bcat_boxcat_local) { |
| 416 | LOG_INFO(Service_BCAT, "Boxcat using local data by override, skipping download."); | 416 | LOG_INFO(Service_BCAT, "Boxcat using local data by override, skipping download."); |
| 417 | } else { | 417 | } else { |
| 418 | Boxcat::Client client{path, title.title_id, title.build_id}; | 418 | Client launch_client{path, title.title_id, title.build_id}; |
| 419 | 419 | ||
| 420 | const auto res = client.DownloadLaunchParam(); | 420 | const auto res = launch_client.DownloadLaunchParam(); |
| 421 | if (res != DownloadResult::Success) { | 421 | if (res != DownloadResult::Success) { |
| 422 | LOG_ERROR(Service_BCAT, "Boxcat synchronization failed with error '{}'!", res); | 422 | LOG_ERROR(Service_BCAT, "Boxcat synchronization failed with error '{}'!", res); |
| 423 | 423 | ||
diff --git a/src/core/hle/service/bcat/module.cpp b/src/core/hle/service/bcat/module.cpp index c7dd04a6e..285085f2a 100644 --- a/src/core/hle/service/bcat/module.cpp +++ b/src/core/hle/service/bcat/module.cpp | |||
| @@ -174,9 +174,9 @@ private: | |||
| 174 | }; | 174 | }; |
| 175 | 175 | ||
| 176 | std::shared_ptr<IDeliveryCacheProgressService> CreateProgressService(SyncType type) { | 176 | std::shared_ptr<IDeliveryCacheProgressService> CreateProgressService(SyncType type) { |
| 177 | auto& backend{progress.at(static_cast<std::size_t>(type))}; | 177 | auto& progress_backend{GetProgressBackend(type)}; |
| 178 | return std::make_shared<IDeliveryCacheProgressService>(system, backend.GetEvent(), | 178 | return std::make_shared<IDeliveryCacheProgressService>(system, progress_backend.GetEvent(), |
| 179 | backend.GetImpl()); | 179 | progress_backend.GetImpl()); |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | void RequestSyncDeliveryCache(Kernel::HLERequestContext& ctx) { | 182 | void RequestSyncDeliveryCache(Kernel::HLERequestContext& ctx) { |
| @@ -184,7 +184,7 @@ private: | |||
| 184 | 184 | ||
| 185 | backend.Synchronize({system.CurrentProcess()->GetTitleID(), | 185 | backend.Synchronize({system.CurrentProcess()->GetTitleID(), |
| 186 | GetCurrentBuildID(system.GetCurrentProcessBuildID())}, | 186 | GetCurrentBuildID(system.GetCurrentProcessBuildID())}, |
| 187 | progress.at(static_cast<std::size_t>(SyncType::Normal))); | 187 | GetProgressBackend(SyncType::Normal)); |
| 188 | 188 | ||
| 189 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 189 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 190 | rb.Push(RESULT_SUCCESS); | 190 | rb.Push(RESULT_SUCCESS); |
| @@ -201,8 +201,7 @@ private: | |||
| 201 | 201 | ||
| 202 | backend.SynchronizeDirectory({system.CurrentProcess()->GetTitleID(), | 202 | backend.SynchronizeDirectory({system.CurrentProcess()->GetTitleID(), |
| 203 | GetCurrentBuildID(system.GetCurrentProcessBuildID())}, | 203 | GetCurrentBuildID(system.GetCurrentProcessBuildID())}, |
| 204 | name, | 204 | name, GetProgressBackend(SyncType::Directory)); |
| 205 | progress.at(static_cast<std::size_t>(SyncType::Directory))); | ||
| 206 | 205 | ||
| 207 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 206 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 208 | rb.Push(RESULT_SUCCESS); | 207 | rb.Push(RESULT_SUCCESS); |
| @@ -265,9 +264,16 @@ private: | |||
| 265 | rb.Push(RESULT_SUCCESS); | 264 | rb.Push(RESULT_SUCCESS); |
| 266 | } | 265 | } |
| 267 | 266 | ||
| 268 | Backend& backend; | 267 | ProgressServiceBackend& GetProgressBackend(SyncType type) { |
| 268 | return progress.at(static_cast<size_t>(type)); | ||
| 269 | } | ||
| 269 | 270 | ||
| 270 | std::array<ProgressServiceBackend, static_cast<std::size_t>(SyncType::Count)> progress; | 271 | const ProgressServiceBackend& GetProgressBackend(SyncType type) const { |
| 272 | return progress.at(static_cast<size_t>(type)); | ||
| 273 | } | ||
| 274 | |||
| 275 | Backend& backend; | ||
| 276 | std::array<ProgressServiceBackend, static_cast<size_t>(SyncType::Count)> progress; | ||
| 271 | }; | 277 | }; |
| 272 | 278 | ||
| 273 | void Module::Interface::CreateBcatService(Kernel::HLERequestContext& ctx) { | 279 | void Module::Interface::CreateBcatService(Kernel::HLERequestContext& ctx) { |
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index a0215c4d7..7dc487e48 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp | |||
| @@ -337,13 +337,14 @@ public: | |||
| 337 | const auto file_buffer = ctx.ReadBuffer(); | 337 | const auto file_buffer = ctx.ReadBuffer(); |
| 338 | const std::string name = Common::StringFromBuffer(file_buffer); | 338 | const std::string name = Common::StringFromBuffer(file_buffer); |
| 339 | 339 | ||
| 340 | const u64 mode = rp.Pop<u64>(); | 340 | const u64 file_mode = rp.Pop<u64>(); |
| 341 | const u32 size = rp.Pop<u32>(); | 341 | const u32 file_size = rp.Pop<u32>(); |
| 342 | 342 | ||
| 343 | LOG_DEBUG(Service_FS, "called. file={}, mode=0x{:X}, size=0x{:08X}", name, mode, size); | 343 | LOG_DEBUG(Service_FS, "called. file={}, mode=0x{:X}, size=0x{:08X}", name, file_mode, |
| 344 | file_size); | ||
| 344 | 345 | ||
| 345 | IPC::ResponseBuilder rb{ctx, 2}; | 346 | IPC::ResponseBuilder rb{ctx, 2}; |
| 346 | rb.Push(backend.CreateFile(name, size)); | 347 | rb.Push(backend.CreateFile(name, file_size)); |
| 347 | } | 348 | } |
| 348 | 349 | ||
| 349 | void DeleteFile(Kernel::HLERequestContext& ctx) { | 350 | void DeleteFile(Kernel::HLERequestContext& ctx) { |
| @@ -935,8 +936,8 @@ void FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute( | |||
| 935 | void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) { | 936 | void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) { |
| 936 | LOG_DEBUG(Service_FS, "called"); | 937 | LOG_DEBUG(Service_FS, "called"); |
| 937 | 938 | ||
| 938 | auto romfs = fsc.OpenRomFSCurrentProcess(); | 939 | auto current_romfs = fsc.OpenRomFSCurrentProcess(); |
| 939 | if (romfs.Failed()) { | 940 | if (current_romfs.Failed()) { |
| 940 | // TODO (bunnei): Find the right error code to use here | 941 | // TODO (bunnei): Find the right error code to use here |
| 941 | LOG_CRITICAL(Service_FS, "no file system interface available!"); | 942 | LOG_CRITICAL(Service_FS, "no file system interface available!"); |
| 942 | IPC::ResponseBuilder rb{ctx, 2}; | 943 | IPC::ResponseBuilder rb{ctx, 2}; |
| @@ -944,7 +945,7 @@ void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) { | |||
| 944 | return; | 945 | return; |
| 945 | } | 946 | } |
| 946 | 947 | ||
| 947 | auto storage = std::make_shared<IStorage>(system, std::move(romfs.Unwrap())); | 948 | auto storage = std::make_shared<IStorage>(system, std::move(current_romfs.Unwrap())); |
| 948 | 949 | ||
| 949 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 950 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 950 | rb.Push(RESULT_SUCCESS); | 951 | rb.Push(RESULT_SUCCESS); |
| @@ -1010,10 +1011,10 @@ void FSP_SRV::OpenDataStorageWithProgramIndex(Kernel::HLERequestContext& ctx) { | |||
| 1010 | 1011 | ||
| 1011 | LOG_DEBUG(Service_FS, "called, program_index={}", program_index); | 1012 | LOG_DEBUG(Service_FS, "called, program_index={}", program_index); |
| 1012 | 1013 | ||
| 1013 | auto romfs = fsc.OpenPatchedRomFSWithProgramIndex( | 1014 | auto patched_romfs = fsc.OpenPatchedRomFSWithProgramIndex( |
| 1014 | system.CurrentProcess()->GetTitleID(), program_index, FileSys::ContentRecordType::Program); | 1015 | system.CurrentProcess()->GetTitleID(), program_index, FileSys::ContentRecordType::Program); |
| 1015 | 1016 | ||
| 1016 | if (romfs.Failed()) { | 1017 | if (patched_romfs.Failed()) { |
| 1017 | // TODO: Find the right error code to use here | 1018 | // TODO: Find the right error code to use here |
| 1018 | LOG_ERROR(Service_FS, "could not open storage with program_index={}", program_index); | 1019 | LOG_ERROR(Service_FS, "could not open storage with program_index={}", program_index); |
| 1019 | 1020 | ||
| @@ -1022,7 +1023,7 @@ void FSP_SRV::OpenDataStorageWithProgramIndex(Kernel::HLERequestContext& ctx) { | |||
| 1022 | return; | 1023 | return; |
| 1023 | } | 1024 | } |
| 1024 | 1025 | ||
| 1025 | auto storage = std::make_shared<IStorage>(system, std::move(romfs.Unwrap())); | 1026 | auto storage = std::make_shared<IStorage>(system, std::move(patched_romfs.Unwrap())); |
| 1026 | 1027 | ||
| 1027 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 1028 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 1028 | rb.Push(RESULT_SUCCESS); | 1029 | rb.Push(RESULT_SUCCESS); |
diff --git a/src/core/hle/service/glue/ectx.cpp b/src/core/hle/service/glue/ectx.cpp new file mode 100644 index 000000000..249c6f003 --- /dev/null +++ b/src/core/hle/service/glue/ectx.cpp | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/hle/service/glue/ectx.h" | ||
| 6 | |||
| 7 | namespace Service::Glue { | ||
| 8 | |||
| 9 | ECTX_AW::ECTX_AW(Core::System& system_) : ServiceFramework{system_, "ectx:aw"} { | ||
| 10 | // clang-format off | ||
| 11 | static const FunctionInfo functions[] = { | ||
| 12 | {0, nullptr, "CreateContextRegistrar"}, | ||
| 13 | {1, nullptr, "CommitContext"}, | ||
| 14 | }; | ||
| 15 | // clang-format on | ||
| 16 | |||
| 17 | RegisterHandlers(functions); | ||
| 18 | } | ||
| 19 | |||
| 20 | ECTX_AW::~ECTX_AW() = default; | ||
| 21 | |||
| 22 | } // namespace Service::Glue | ||
diff --git a/src/core/hle/service/glue/ectx.h b/src/core/hle/service/glue/ectx.h new file mode 100644 index 000000000..b275e808a --- /dev/null +++ b/src/core/hle/service/glue/ectx.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/service/service.h" | ||
| 8 | |||
| 9 | namespace Core { | ||
| 10 | class System; | ||
| 11 | } | ||
| 12 | |||
| 13 | namespace Service::Glue { | ||
| 14 | |||
| 15 | class ECTX_AW final : public ServiceFramework<ECTX_AW> { | ||
| 16 | public: | ||
| 17 | explicit ECTX_AW(Core::System& system_); | ||
| 18 | ~ECTX_AW() override; | ||
| 19 | }; | ||
| 20 | |||
| 21 | } // namespace Service::Glue | ||
diff --git a/src/core/hle/service/glue/glue.cpp b/src/core/hle/service/glue/glue.cpp index 4eafbe5fa..a08dc9758 100644 --- a/src/core/hle/service/glue/glue.cpp +++ b/src/core/hle/service/glue/glue.cpp | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #include "core/core.h" | 6 | #include "core/core.h" |
| 7 | #include "core/hle/service/glue/arp.h" | 7 | #include "core/hle/service/glue/arp.h" |
| 8 | #include "core/hle/service/glue/bgtc.h" | 8 | #include "core/hle/service/glue/bgtc.h" |
| 9 | #include "core/hle/service/glue/ectx.h" | ||
| 9 | #include "core/hle/service/glue/glue.h" | 10 | #include "core/hle/service/glue/glue.h" |
| 10 | 11 | ||
| 11 | namespace Service::Glue { | 12 | namespace Service::Glue { |
| @@ -20,6 +21,9 @@ void InstallInterfaces(Core::System& system) { | |||
| 20 | // BackGround Task Controller | 21 | // BackGround Task Controller |
| 21 | std::make_shared<BGTC_T>(system)->InstallAsService(system.ServiceManager()); | 22 | std::make_shared<BGTC_T>(system)->InstallAsService(system.ServiceManager()); |
| 22 | std::make_shared<BGTC_SC>(system)->InstallAsService(system.ServiceManager()); | 23 | std::make_shared<BGTC_SC>(system)->InstallAsService(system.ServiceManager()); |
| 24 | |||
| 25 | // Error Context | ||
| 26 | std::make_shared<ECTX_AW>(system)->InstallAsService(system.ServiceManager()); | ||
| 23 | } | 27 | } |
| 24 | 28 | ||
| 25 | } // namespace Service::Glue | 29 | } // namespace Service::Glue |
diff --git a/src/core/hle/service/lbl/lbl.cpp b/src/core/hle/service/lbl/lbl.cpp index f4490f3d9..e11a0c45a 100644 --- a/src/core/hle/service/lbl/lbl.cpp +++ b/src/core/hle/service/lbl/lbl.cpp | |||
| @@ -79,7 +79,6 @@ private: | |||
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | void GetCurrentBrightnessSetting(Kernel::HLERequestContext& ctx) { | 81 | void GetCurrentBrightnessSetting(Kernel::HLERequestContext& ctx) { |
| 82 | IPC::RequestParser rp{ctx}; | ||
| 83 | auto brightness = current_brightness; | 82 | auto brightness = current_brightness; |
| 84 | if (!std::isfinite(brightness)) { | 83 | if (!std::isfinite(brightness)) { |
| 85 | LOG_ERROR(Service_LBL, "Brightness is infinite!"); | 84 | LOG_ERROR(Service_LBL, "Brightness is infinite!"); |
| @@ -272,7 +271,6 @@ private: | |||
| 272 | } | 271 | } |
| 273 | 272 | ||
| 274 | void GetCurrentBrightnessSettingForVrMode(Kernel::HLERequestContext& ctx) { | 273 | void GetCurrentBrightnessSettingForVrMode(Kernel::HLERequestContext& ctx) { |
| 275 | IPC::RequestParser rp{ctx}; | ||
| 276 | auto brightness = current_vr_brightness; | 274 | auto brightness = current_vr_brightness; |
| 277 | if (!std::isfinite(brightness)) { | 275 | if (!std::isfinite(brightness)) { |
| 278 | LOG_ERROR(Service_LBL, "Brightness is infinite!"); | 276 | LOG_ERROR(Service_LBL, "Brightness is infinite!"); |
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp index 7d7542fc2..9bcf8870d 100644 --- a/src/core/hle/service/lm/lm.cpp +++ b/src/core/hle/service/lm/lm.cpp | |||
| @@ -46,7 +46,7 @@ struct hash<Service::LM::LogPacketHeaderEntry> { | |||
| 46 | boost::hash_combine(seed, k.severity); | 46 | boost::hash_combine(seed, k.severity); |
| 47 | boost::hash_combine(seed, k.verbosity); | 47 | boost::hash_combine(seed, k.verbosity); |
| 48 | return seed; | 48 | return seed; |
| 49 | }; | 49 | } |
| 50 | }; | 50 | }; |
| 51 | } // namespace std | 51 | } // namespace std |
| 52 | 52 | ||
| @@ -95,7 +95,7 @@ private: | |||
| 95 | std::memcpy(&header, data.data(), sizeof(LogPacketHeader)); | 95 | std::memcpy(&header, data.data(), sizeof(LogPacketHeader)); |
| 96 | offset += sizeof(LogPacketHeader); | 96 | offset += sizeof(LogPacketHeader); |
| 97 | 97 | ||
| 98 | LogPacketHeaderEntry entry{ | 98 | const LogPacketHeaderEntry entry{ |
| 99 | .pid = header.pid, | 99 | .pid = header.pid, |
| 100 | .tid = header.tid, | 100 | .tid = header.tid, |
| 101 | .severity = header.severity, | 101 | .severity = header.severity, |
| @@ -105,16 +105,17 @@ private: | |||
| 105 | if (True(header.flags & LogPacketFlags::Head)) { | 105 | if (True(header.flags & LogPacketFlags::Head)) { |
| 106 | std::vector<u8> tmp(data.size() - sizeof(LogPacketHeader)); | 106 | std::vector<u8> tmp(data.size() - sizeof(LogPacketHeader)); |
| 107 | std::memcpy(tmp.data(), data.data() + offset, tmp.size()); | 107 | std::memcpy(tmp.data(), data.data() + offset, tmp.size()); |
| 108 | entries[entry] = std::move(tmp); | 108 | entries.insert_or_assign(entry, std::move(tmp)); |
| 109 | } else { | 109 | } else { |
| 110 | const auto entry_iter = entries.find(entry); | ||
| 111 | |||
| 110 | // Append to existing entry | 112 | // Append to existing entry |
| 111 | if (!entries.contains(entry)) { | 113 | if (entry_iter == entries.cend()) { |
| 112 | LOG_ERROR(Service_LM, "Log entry does not exist!"); | 114 | LOG_ERROR(Service_LM, "Log entry does not exist!"); |
| 113 | return; | 115 | return; |
| 114 | } | 116 | } |
| 115 | std::vector<u8> tmp(data.size() - sizeof(LogPacketHeader)); | ||
| 116 | 117 | ||
| 117 | auto& existing_entry = entries[entry]; | 118 | auto& existing_entry = entry_iter->second; |
| 118 | const auto base = existing_entry.size(); | 119 | const auto base = existing_entry.size(); |
| 119 | existing_entry.resize(base + (data.size() - sizeof(LogPacketHeader))); | 120 | existing_entry.resize(base + (data.size() - sizeof(LogPacketHeader))); |
| 120 | std::memcpy(existing_entry.data() + base, data.data() + offset, | 121 | std::memcpy(existing_entry.data() + base, data.data() + offset, |
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp index 4e58b9b80..e2f671d8e 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp | |||
| @@ -31,9 +31,8 @@ NvResult nvhost_nvdec::Ioctl1(DeviceFD fd, Ioctl command, const std::vector<u8>& | |||
| 31 | return SetSubmitTimeout(input, output); | 31 | return SetSubmitTimeout(input, output); |
| 32 | case 0x9: | 32 | case 0x9: |
| 33 | return MapBuffer(input, output); | 33 | return MapBuffer(input, output); |
| 34 | case 0xa: { | 34 | case 0xa: |
| 35 | return UnmapBuffer(input, output); | 35 | return UnmapBuffer(input, output); |
| 36 | } | ||
| 37 | default: | 36 | default: |
| 38 | break; | 37 | break; |
| 39 | } | 38 | } |
| @@ -67,7 +66,8 @@ NvResult nvhost_nvdec::Ioctl3(DeviceFD fd, Ioctl command, const std::vector<u8>& | |||
| 67 | void nvhost_nvdec::OnOpen(DeviceFD fd) {} | 66 | void nvhost_nvdec::OnOpen(DeviceFD fd) {} |
| 68 | 67 | ||
| 69 | void nvhost_nvdec::OnClose(DeviceFD fd) { | 68 | void nvhost_nvdec::OnClose(DeviceFD fd) { |
| 70 | system.GPU().ClearCommandBuffer(); | 69 | LOG_INFO(Service_NVDRV, "NVDEC video stream ended"); |
| 70 | system.GPU().ClearCdmaInstance(); | ||
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | } // namespace Service::Nvidia::Devices | 73 | } // namespace Service::Nvidia::Devices |
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp b/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp index 0421fb956..301efe8a1 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp | |||
| @@ -29,13 +29,8 @@ NvResult nvhost_vic::Ioctl1(DeviceFD fd, Ioctl command, const std::vector<u8>& i | |||
| 29 | return GetWaitbase(input, output); | 29 | return GetWaitbase(input, output); |
| 30 | case 0x9: | 30 | case 0x9: |
| 31 | return MapBuffer(input, output); | 31 | return MapBuffer(input, output); |
| 32 | case 0xa: { | 32 | case 0xa: |
| 33 | if (command.length == 0x1c) { | ||
| 34 | Tegra::ChCommandHeaderList cmdlist{{0xDEADB33F}}; | ||
| 35 | system.GPU().PushCommandBuffer(cmdlist); | ||
| 36 | } | ||
| 37 | return UnmapBuffer(input, output); | 33 | return UnmapBuffer(input, output); |
| 38 | } | ||
| 39 | default: | 34 | default: |
| 40 | break; | 35 | break; |
| 41 | } | 36 | } |
| @@ -69,6 +64,9 @@ NvResult nvhost_vic::Ioctl3(DeviceFD fd, Ioctl command, const std::vector<u8>& i | |||
| 69 | } | 64 | } |
| 70 | 65 | ||
| 71 | void nvhost_vic::OnOpen(DeviceFD fd) {} | 66 | void nvhost_vic::OnOpen(DeviceFD fd) {} |
| 72 | void nvhost_vic::OnClose(DeviceFD fd) {} | 67 | |
| 68 | void nvhost_vic::OnClose(DeviceFD fd) { | ||
| 69 | system.GPU().ClearCdmaInstance(); | ||
| 70 | } | ||
| 73 | 71 | ||
| 74 | } // namespace Service::Nvidia::Devices | 72 | } // namespace Service::Nvidia::Devices |
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index 539b02bc4..c43593e7f 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp | |||
| @@ -72,7 +72,7 @@ NVFlinger::NVFlinger(Core::System& system) : system(system) { | |||
| 72 | // Schedule the screen composition events | 72 | // Schedule the screen composition events |
| 73 | composition_event = Core::Timing::CreateEvent( | 73 | composition_event = Core::Timing::CreateEvent( |
| 74 | "ScreenComposition", [this](std::uintptr_t, std::chrono::nanoseconds ns_late) { | 74 | "ScreenComposition", [this](std::uintptr_t, std::chrono::nanoseconds ns_late) { |
| 75 | const auto guard = Lock(); | 75 | const auto lock_guard = Lock(); |
| 76 | Compose(); | 76 | Compose(); |
| 77 | 77 | ||
| 78 | const auto ticks = std::chrono::nanoseconds{GetNextTicks()}; | 78 | const auto ticks = std::chrono::nanoseconds{GetNextTicks()}; |
| @@ -112,7 +112,7 @@ void NVFlinger::SetNVDrvInstance(std::shared_ptr<Nvidia::Module> instance) { | |||
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | std::optional<u64> NVFlinger::OpenDisplay(std::string_view name) { | 114 | std::optional<u64> NVFlinger::OpenDisplay(std::string_view name) { |
| 115 | const auto guard = Lock(); | 115 | const auto lock_guard = Lock(); |
| 116 | 116 | ||
| 117 | LOG_DEBUG(Service, "Opening \"{}\" display", name); | 117 | LOG_DEBUG(Service, "Opening \"{}\" display", name); |
| 118 | 118 | ||
| @@ -131,7 +131,7 @@ std::optional<u64> NVFlinger::OpenDisplay(std::string_view name) { | |||
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | std::optional<u64> NVFlinger::CreateLayer(u64 display_id) { | 133 | std::optional<u64> NVFlinger::CreateLayer(u64 display_id) { |
| 134 | const auto guard = Lock(); | 134 | const auto lock_guard = Lock(); |
| 135 | auto* const display = FindDisplay(display_id); | 135 | auto* const display = FindDisplay(display_id); |
| 136 | 136 | ||
| 137 | if (display == nullptr) { | 137 | if (display == nullptr) { |
| @@ -147,7 +147,7 @@ std::optional<u64> NVFlinger::CreateLayer(u64 display_id) { | |||
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | void NVFlinger::CloseLayer(u64 layer_id) { | 149 | void NVFlinger::CloseLayer(u64 layer_id) { |
| 150 | const auto guard = Lock(); | 150 | const auto lock_guard = Lock(); |
| 151 | 151 | ||
| 152 | for (auto& display : displays) { | 152 | for (auto& display : displays) { |
| 153 | display.CloseLayer(layer_id); | 153 | display.CloseLayer(layer_id); |
| @@ -155,7 +155,7 @@ void NVFlinger::CloseLayer(u64 layer_id) { | |||
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | std::optional<u32> NVFlinger::FindBufferQueueId(u64 display_id, u64 layer_id) const { | 157 | std::optional<u32> NVFlinger::FindBufferQueueId(u64 display_id, u64 layer_id) const { |
| 158 | const auto guard = Lock(); | 158 | const auto lock_guard = Lock(); |
| 159 | const auto* const layer = FindLayer(display_id, layer_id); | 159 | const auto* const layer = FindLayer(display_id, layer_id); |
| 160 | 160 | ||
| 161 | if (layer == nullptr) { | 161 | if (layer == nullptr) { |
| @@ -166,7 +166,7 @@ std::optional<u32> NVFlinger::FindBufferQueueId(u64 display_id, u64 layer_id) co | |||
| 166 | } | 166 | } |
| 167 | 167 | ||
| 168 | std::shared_ptr<Kernel::KReadableEvent> NVFlinger::FindVsyncEvent(u64 display_id) const { | 168 | std::shared_ptr<Kernel::KReadableEvent> NVFlinger::FindVsyncEvent(u64 display_id) const { |
| 169 | const auto guard = Lock(); | 169 | const auto lock_guard = Lock(); |
| 170 | auto* const display = FindDisplay(display_id); | 170 | auto* const display = FindDisplay(display_id); |
| 171 | 171 | ||
| 172 | if (display == nullptr) { | 172 | if (display == nullptr) { |
| @@ -177,7 +177,7 @@ std::shared_ptr<Kernel::KReadableEvent> NVFlinger::FindVsyncEvent(u64 display_id | |||
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | BufferQueue* NVFlinger::FindBufferQueue(u32 id) { | 179 | BufferQueue* NVFlinger::FindBufferQueue(u32 id) { |
| 180 | const auto guard = Lock(); | 180 | const auto lock_guard = Lock(); |
| 181 | const auto itr = std::find_if(buffer_queues.begin(), buffer_queues.end(), | 181 | const auto itr = std::find_if(buffer_queues.begin(), buffer_queues.end(), |
| 182 | [id](const auto& queue) { return queue->GetId() == id; }); | 182 | [id](const auto& queue) { return queue->GetId() == id; }); |
| 183 | 183 | ||
diff --git a/src/core/hle/service/time/standard_user_system_clock_core.cpp b/src/core/hle/service/time/standard_user_system_clock_core.cpp index b9faa474e..3172acc5a 100644 --- a/src/core/hle/service/time/standard_user_system_clock_core.cpp +++ b/src/core/hle/service/time/standard_user_system_clock_core.cpp | |||
| @@ -45,12 +45,12 @@ ResultCode StandardUserSystemClockCore::GetClockContext(Core::System& system, | |||
| 45 | return local_system_clock_core.GetClockContext(system, context); | 45 | return local_system_clock_core.GetClockContext(system, context); |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | ResultCode StandardUserSystemClockCore::Flush(const SystemClockContext& context) { | 48 | ResultCode StandardUserSystemClockCore::Flush(const SystemClockContext&) { |
| 49 | UNREACHABLE(); | 49 | UNREACHABLE(); |
| 50 | return ERROR_NOT_IMPLEMENTED; | 50 | return ERROR_NOT_IMPLEMENTED; |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | ResultCode StandardUserSystemClockCore::SetClockContext(const SystemClockContext& context) { | 53 | ResultCode StandardUserSystemClockCore::SetClockContext(const SystemClockContext&) { |
| 54 | UNREACHABLE(); | 54 | UNREACHABLE(); |
| 55 | return ERROR_NOT_IMPLEMENTED; | 55 | return ERROR_NOT_IMPLEMENTED; |
| 56 | } | 56 | } |
diff --git a/src/core/hle/service/time/standard_user_system_clock_core.h b/src/core/hle/service/time/standard_user_system_clock_core.h index aac44d72f..5bc8bf5c2 100644 --- a/src/core/hle/service/time/standard_user_system_clock_core.h +++ b/src/core/hle/service/time/standard_user_system_clock_core.h | |||
| @@ -39,7 +39,7 @@ public: | |||
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | protected: | 41 | protected: |
| 42 | ResultCode Flush(const SystemClockContext& context) override; | 42 | ResultCode Flush(const SystemClockContext&) override; |
| 43 | 43 | ||
| 44 | ResultCode SetClockContext(const SystemClockContext&) override; | 44 | ResultCode SetClockContext(const SystemClockContext&) override; |
| 45 | 45 | ||
diff --git a/src/core/hle/service/time/system_clock_core.cpp b/src/core/hle/service/time/system_clock_core.cpp index d31d4e2ca..46fc8c6c3 100644 --- a/src/core/hle/service/time/system_clock_core.cpp +++ b/src/core/hle/service/time/system_clock_core.cpp | |||
| @@ -45,18 +45,18 @@ ResultCode SystemClockCore::SetCurrentTime(Core::System& system, s64 posix_time) | |||
| 45 | return Flush(clock_context); | 45 | return Flush(clock_context); |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | ResultCode SystemClockCore::Flush(const SystemClockContext& context) { | 48 | ResultCode SystemClockCore::Flush(const SystemClockContext& clock_context) { |
| 49 | if (!system_clock_context_update_callback) { | 49 | if (!system_clock_context_update_callback) { |
| 50 | return RESULT_SUCCESS; | 50 | return RESULT_SUCCESS; |
| 51 | } | 51 | } |
| 52 | return system_clock_context_update_callback->Update(context); | 52 | return system_clock_context_update_callback->Update(clock_context); |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | ResultCode SystemClockCore::SetSystemClockContext(const SystemClockContext& context) { | 55 | ResultCode SystemClockCore::SetSystemClockContext(const SystemClockContext& clock_context) { |
| 56 | if (const ResultCode result{SetClockContext(context)}; result != RESULT_SUCCESS) { | 56 | if (const ResultCode result{SetClockContext(clock_context)}; result != RESULT_SUCCESS) { |
| 57 | return result; | 57 | return result; |
| 58 | } | 58 | } |
| 59 | return Flush(context); | 59 | return Flush(clock_context); |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | bool SystemClockCore::IsClockSetup(Core::System& system) const { | 62 | bool SystemClockCore::IsClockSetup(Core::System& system) const { |
diff --git a/src/core/hle/service/time/system_clock_core.h b/src/core/hle/service/time/system_clock_core.h index 608dd3b2e..82a8b79ff 100644 --- a/src/core/hle/service/time/system_clock_core.h +++ b/src/core/hle/service/time/system_clock_core.h | |||
| @@ -43,7 +43,7 @@ public: | |||
| 43 | return RESULT_SUCCESS; | 43 | return RESULT_SUCCESS; |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | virtual ResultCode Flush(const SystemClockContext& context); | 46 | virtual ResultCode Flush(const SystemClockContext& clock_context); |
| 47 | 47 | ||
| 48 | void SetUpdateCallbackInstance(std::shared_ptr<SystemClockContextUpdateCallback> callback) { | 48 | void SetUpdateCallbackInstance(std::shared_ptr<SystemClockContextUpdateCallback> callback) { |
| 49 | system_clock_context_update_callback = std::move(callback); | 49 | system_clock_context_update_callback = std::move(callback); |
diff --git a/src/core/hle/service/time/time_manager.cpp b/src/core/hle/service/time/time_manager.cpp index f89c5aaad..fe01a3739 100644 --- a/src/core/hle/service/time/time_manager.cpp +++ b/src/core/hle/service/time/time_manager.cpp | |||
| @@ -129,7 +129,7 @@ struct TimeManager::Impl final { | |||
| 129 | return 0; | 129 | return 0; |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | void SetupStandardSteadyClock(Core::System& system, Common::UUID clock_source_id, | 132 | void SetupStandardSteadyClock(Core::System& system_, Common::UUID clock_source_id, |
| 133 | Clock::TimeSpanType setup_value, | 133 | Clock::TimeSpanType setup_value, |
| 134 | Clock::TimeSpanType internal_offset, bool is_rtc_reset_detected) { | 134 | Clock::TimeSpanType internal_offset, bool is_rtc_reset_detected) { |
| 135 | standard_steady_clock_core.SetClockSourceId(clock_source_id); | 135 | standard_steady_clock_core.SetClockSourceId(clock_source_id); |
| @@ -137,21 +137,21 @@ struct TimeManager::Impl final { | |||
| 137 | standard_steady_clock_core.SetInternalOffset(internal_offset); | 137 | standard_steady_clock_core.SetInternalOffset(internal_offset); |
| 138 | standard_steady_clock_core.MarkAsInitialized(); | 138 | standard_steady_clock_core.MarkAsInitialized(); |
| 139 | 139 | ||
| 140 | const auto current_time_point{standard_steady_clock_core.GetCurrentRawTimePoint(system)}; | 140 | const auto current_time_point{standard_steady_clock_core.GetCurrentRawTimePoint(system_)}; |
| 141 | shared_memory.SetupStandardSteadyClock(system, clock_source_id, current_time_point); | 141 | shared_memory.SetupStandardSteadyClock(clock_source_id, current_time_point); |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | void SetupStandardLocalSystemClock(Core::System& system, | 144 | void SetupStandardLocalSystemClock(Core::System& system_, |
| 145 | Clock::SystemClockContext clock_context, s64 posix_time) { | 145 | Clock::SystemClockContext clock_context, s64 posix_time) { |
| 146 | standard_local_system_clock_core.SetUpdateCallbackInstance( | 146 | standard_local_system_clock_core.SetUpdateCallbackInstance( |
| 147 | local_system_clock_context_writer); | 147 | local_system_clock_context_writer); |
| 148 | 148 | ||
| 149 | const auto current_time_point{ | 149 | const auto current_time_point{ |
| 150 | standard_local_system_clock_core.GetSteadyClockCore().GetCurrentTimePoint(system)}; | 150 | standard_local_system_clock_core.GetSteadyClockCore().GetCurrentTimePoint(system_)}; |
| 151 | if (current_time_point.clock_source_id == clock_context.steady_time_point.clock_source_id) { | 151 | if (current_time_point.clock_source_id == clock_context.steady_time_point.clock_source_id) { |
| 152 | standard_local_system_clock_core.SetSystemClockContext(clock_context); | 152 | standard_local_system_clock_core.SetSystemClockContext(clock_context); |
| 153 | } else { | 153 | } else { |
| 154 | if (standard_local_system_clock_core.SetCurrentTime(system, posix_time) != | 154 | if (standard_local_system_clock_core.SetCurrentTime(system_, posix_time) != |
| 155 | RESULT_SUCCESS) { | 155 | RESULT_SUCCESS) { |
| 156 | UNREACHABLE(); | 156 | UNREACHABLE(); |
| 157 | return; | 157 | return; |
| @@ -177,10 +177,10 @@ struct TimeManager::Impl final { | |||
| 177 | standard_network_system_clock_core.MarkAsInitialized(); | 177 | standard_network_system_clock_core.MarkAsInitialized(); |
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | void SetupStandardUserSystemClock(Core::System& system, bool is_automatic_correction_enabled, | 180 | void SetupStandardUserSystemClock(Core::System& system_, bool is_automatic_correction_enabled, |
| 181 | Clock::SteadyClockTimePoint steady_clock_time_point) { | 181 | Clock::SteadyClockTimePoint steady_clock_time_point) { |
| 182 | if (standard_user_system_clock_core.SetAutomaticCorrectionEnabled( | 182 | if (standard_user_system_clock_core.SetAutomaticCorrectionEnabled( |
| 183 | system, is_automatic_correction_enabled) != RESULT_SUCCESS) { | 183 | system_, is_automatic_correction_enabled) != RESULT_SUCCESS) { |
| 184 | UNREACHABLE(); | 184 | UNREACHABLE(); |
| 185 | return; | 185 | return; |
| 186 | } | 186 | } |
| @@ -196,10 +196,10 @@ struct TimeManager::Impl final { | |||
| 196 | ephemeral_network_system_clock_core.MarkAsInitialized(); | 196 | ephemeral_network_system_clock_core.MarkAsInitialized(); |
| 197 | } | 197 | } |
| 198 | 198 | ||
| 199 | void UpdateLocalSystemClockTime(Core::System& system, s64 posix_time) { | 199 | void UpdateLocalSystemClockTime(Core::System& system_, s64 posix_time) { |
| 200 | const auto timespan{Service::Time::Clock::TimeSpanType::FromSeconds(posix_time)}; | 200 | const auto timespan{Clock::TimeSpanType::FromSeconds(posix_time)}; |
| 201 | if (GetStandardLocalSystemClockCore() | 201 | if (GetStandardLocalSystemClockCore() |
| 202 | .SetCurrentTime(system, timespan.ToSeconds()) | 202 | .SetCurrentTime(system_, timespan.ToSeconds()) |
| 203 | .IsError()) { | 203 | .IsError()) { |
| 204 | UNREACHABLE(); | 204 | UNREACHABLE(); |
| 205 | return; | 205 | return; |
diff --git a/src/core/hle/service/time/time_sharedmemory.cpp b/src/core/hle/service/time/time_sharedmemory.cpp index 4d8de81be..018ce94ed 100644 --- a/src/core/hle/service/time/time_sharedmemory.cpp +++ b/src/core/hle/service/time/time_sharedmemory.cpp | |||
| @@ -26,8 +26,7 @@ std::shared_ptr<Kernel::KSharedMemory> SharedMemory::GetSharedMemoryHolder() con | |||
| 26 | return shared_memory_holder; | 26 | return shared_memory_holder; |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | void SharedMemory::SetupStandardSteadyClock(Core::System& system, | 29 | void SharedMemory::SetupStandardSteadyClock(const Common::UUID& clock_source_id, |
| 30 | const Common::UUID& clock_source_id, | ||
| 31 | Clock::TimeSpanType current_time_point) { | 30 | Clock::TimeSpanType current_time_point) { |
| 32 | const Clock::TimeSpanType ticks_time_span{Clock::TimeSpanType::FromTicks( | 31 | const Clock::TimeSpanType ticks_time_span{Clock::TimeSpanType::FromTicks( |
| 33 | system.CoreTiming().GetClockTicks(), Core::Hardware::CNTFREQ)}; | 32 | system.CoreTiming().GetClockTicks(), Core::Hardware::CNTFREQ)}; |
diff --git a/src/core/hle/service/time/time_sharedmemory.h b/src/core/hle/service/time/time_sharedmemory.h index 299680517..3bc749114 100644 --- a/src/core/hle/service/time/time_sharedmemory.h +++ b/src/core/hle/service/time/time_sharedmemory.h | |||
| @@ -56,8 +56,8 @@ public: | |||
| 56 | }; | 56 | }; |
| 57 | static_assert(sizeof(Format) == 0xd8, "Format is an invalid size"); | 57 | static_assert(sizeof(Format) == 0xd8, "Format is an invalid size"); |
| 58 | 58 | ||
| 59 | void SetupStandardSteadyClock(Core::System& system, const Common::UUID& clock_source_id, | 59 | void SetupStandardSteadyClock(const Common::UUID& clock_source_id, |
| 60 | Clock::TimeSpanType currentTimePoint); | 60 | Clock::TimeSpanType current_time_point); |
| 61 | void UpdateLocalSystemClockContext(const Clock::SystemClockContext& context); | 61 | void UpdateLocalSystemClockContext(const Clock::SystemClockContext& context); |
| 62 | void UpdateNetworkSystemClockContext(const Clock::SystemClockContext& context); | 62 | void UpdateNetworkSystemClockContext(const Clock::SystemClockContext& context); |
| 63 | void SetAutomaticCorrectionEnabled(bool is_enabled); | 63 | void SetAutomaticCorrectionEnabled(bool is_enabled); |
diff --git a/src/core/hle/service/vi/display/vi_display.cpp b/src/core/hle/service/vi/display/vi_display.cpp index 7f42aa4a0..ac9e87338 100644 --- a/src/core/hle/service/vi/display/vi_display.cpp +++ b/src/core/hle/service/vi/display/vi_display.cpp | |||
| @@ -41,24 +41,22 @@ void Display::SignalVSyncEvent() { | |||
| 41 | vsync_event->GetWritableEvent()->Signal(); | 41 | vsync_event->GetWritableEvent()->Signal(); |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | void Display::CreateLayer(u64 id, NVFlinger::BufferQueue& buffer_queue) { | 44 | void Display::CreateLayer(u64 layer_id, NVFlinger::BufferQueue& buffer_queue) { |
| 45 | // TODO(Subv): Support more than 1 layer. | 45 | // TODO(Subv): Support more than 1 layer. |
| 46 | ASSERT_MSG(layers.empty(), "Only one layer is supported per display at the moment"); | 46 | ASSERT_MSG(layers.empty(), "Only one layer is supported per display at the moment"); |
| 47 | 47 | ||
| 48 | layers.emplace_back(std::make_shared<Layer>(id, buffer_queue)); | 48 | layers.emplace_back(std::make_shared<Layer>(layer_id, buffer_queue)); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | void Display::CloseLayer(u64 id) { | 51 | void Display::CloseLayer(u64 layer_id) { |
| 52 | layers.erase( | 52 | std::erase_if(layers, [layer_id](const auto& layer) { return layer->GetID() == layer_id; }); |
| 53 | std::remove_if(layers.begin(), layers.end(), | ||
| 54 | [id](const std::shared_ptr<Layer>& layer) { return layer->GetID() == id; }), | ||
| 55 | layers.end()); | ||
| 56 | } | 53 | } |
| 57 | 54 | ||
| 58 | Layer* Display::FindLayer(u64 id) { | 55 | Layer* Display::FindLayer(u64 layer_id) { |
| 59 | const auto itr = | 56 | const auto itr = |
| 60 | std::find_if(layers.begin(), layers.end(), | 57 | std::find_if(layers.begin(), layers.end(), [layer_id](const std::shared_ptr<Layer>& layer) { |
| 61 | [id](const std::shared_ptr<Layer>& layer) { return layer->GetID() == id; }); | 58 | return layer->GetID() == layer_id; |
| 59 | }); | ||
| 62 | 60 | ||
| 63 | if (itr == layers.end()) { | 61 | if (itr == layers.end()) { |
| 64 | return nullptr; | 62 | return nullptr; |
| @@ -67,10 +65,11 @@ Layer* Display::FindLayer(u64 id) { | |||
| 67 | return itr->get(); | 65 | return itr->get(); |
| 68 | } | 66 | } |
| 69 | 67 | ||
| 70 | const Layer* Display::FindLayer(u64 id) const { | 68 | const Layer* Display::FindLayer(u64 layer_id) const { |
| 71 | const auto itr = | 69 | const auto itr = |
| 72 | std::find_if(layers.begin(), layers.end(), | 70 | std::find_if(layers.begin(), layers.end(), [layer_id](const std::shared_ptr<Layer>& layer) { |
| 73 | [id](const std::shared_ptr<Layer>& layer) { return layer->GetID() == id; }); | 71 | return layer->GetID() == layer_id; |
| 72 | }); | ||
| 74 | 73 | ||
| 75 | if (itr == layers.end()) { | 74 | if (itr == layers.end()) { |
| 76 | return nullptr; | 75 | return nullptr; |
diff --git a/src/core/hle/service/vi/display/vi_display.h b/src/core/hle/service/vi/display/vi_display.h index 931c898f6..8340059de 100644 --- a/src/core/hle/service/vi/display/vi_display.h +++ b/src/core/hle/service/vi/display/vi_display.h | |||
| @@ -68,34 +68,34 @@ public: | |||
| 68 | 68 | ||
| 69 | /// Creates and adds a layer to this display with the given ID. | 69 | /// Creates and adds a layer to this display with the given ID. |
| 70 | /// | 70 | /// |
| 71 | /// @param id The ID to assign to the created layer. | 71 | /// @param layer_id The ID to assign to the created layer. |
| 72 | /// @param buffer_queue The buffer queue for the layer instance to use. | 72 | /// @param buffer_queue The buffer queue for the layer instance to use. |
| 73 | /// | 73 | /// |
| 74 | void CreateLayer(u64 id, NVFlinger::BufferQueue& buffer_queue); | 74 | void CreateLayer(u64 layer_id, NVFlinger::BufferQueue& buffer_queue); |
| 75 | 75 | ||
| 76 | /// Closes and removes a layer from this display with the given ID. | 76 | /// Closes and removes a layer from this display with the given ID. |
| 77 | /// | 77 | /// |
| 78 | /// @param id The ID assigned to the layer to close. | 78 | /// @param layer_id The ID assigned to the layer to close. |
| 79 | /// | 79 | /// |
| 80 | void CloseLayer(u64 id); | 80 | void CloseLayer(u64 layer_id); |
| 81 | 81 | ||
| 82 | /// Attempts to find a layer with the given ID. | 82 | /// Attempts to find a layer with the given ID. |
| 83 | /// | 83 | /// |
| 84 | /// @param id The layer ID. | 84 | /// @param layer_id The layer ID. |
| 85 | /// | 85 | /// |
| 86 | /// @returns If found, the Layer instance with the given ID. | 86 | /// @returns If found, the Layer instance with the given ID. |
| 87 | /// If not found, then nullptr is returned. | 87 | /// If not found, then nullptr is returned. |
| 88 | /// | 88 | /// |
| 89 | Layer* FindLayer(u64 id); | 89 | Layer* FindLayer(u64 layer_id); |
| 90 | 90 | ||
| 91 | /// Attempts to find a layer with the given ID. | 91 | /// Attempts to find a layer with the given ID. |
| 92 | /// | 92 | /// |
| 93 | /// @param id The layer ID. | 93 | /// @param layer_id The layer ID. |
| 94 | /// | 94 | /// |
| 95 | /// @returns If found, the Layer instance with the given ID. | 95 | /// @returns If found, the Layer instance with the given ID. |
| 96 | /// If not found, then nullptr is returned. | 96 | /// If not found, then nullptr is returned. |
| 97 | /// | 97 | /// |
| 98 | const Layer* FindLayer(u64 id) const; | 98 | const Layer* FindLayer(u64 layer_id) const; |
| 99 | 99 | ||
| 100 | private: | 100 | private: |
| 101 | u64 id; | 101 | u64 id; |
diff --git a/src/core/loader/deconstructed_rom_directory.cpp b/src/core/loader/deconstructed_rom_directory.cpp index 4a10211f6..ed776fc49 100644 --- a/src/core/loader/deconstructed_rom_directory.cpp +++ b/src/core/loader/deconstructed_rom_directory.cpp | |||
| @@ -24,10 +24,10 @@ namespace Loader { | |||
| 24 | AppLoader_DeconstructedRomDirectory::AppLoader_DeconstructedRomDirectory(FileSys::VirtualFile file_, | 24 | AppLoader_DeconstructedRomDirectory::AppLoader_DeconstructedRomDirectory(FileSys::VirtualFile file_, |
| 25 | bool override_update) | 25 | bool override_update) |
| 26 | : AppLoader(std::move(file_)), override_update(override_update) { | 26 | : AppLoader(std::move(file_)), override_update(override_update) { |
| 27 | const auto dir = file->GetContainingDirectory(); | 27 | const auto file_dir = file->GetContainingDirectory(); |
| 28 | 28 | ||
| 29 | // Title ID | 29 | // Title ID |
| 30 | const auto npdm = dir->GetFile("main.npdm"); | 30 | const auto npdm = file_dir->GetFile("main.npdm"); |
| 31 | if (npdm != nullptr) { | 31 | if (npdm != nullptr) { |
| 32 | const auto res = metadata.Load(npdm); | 32 | const auto res = metadata.Load(npdm); |
| 33 | if (res == ResultStatus::Success) | 33 | if (res == ResultStatus::Success) |
| @@ -37,7 +37,7 @@ AppLoader_DeconstructedRomDirectory::AppLoader_DeconstructedRomDirectory(FileSys | |||
| 37 | // Icon | 37 | // Icon |
| 38 | FileSys::VirtualFile icon_file = nullptr; | 38 | FileSys::VirtualFile icon_file = nullptr; |
| 39 | for (const auto& language : FileSys::LANGUAGE_NAMES) { | 39 | for (const auto& language : FileSys::LANGUAGE_NAMES) { |
| 40 | icon_file = dir->GetFile("icon_" + std::string(language) + ".dat"); | 40 | icon_file = file_dir->GetFile("icon_" + std::string(language) + ".dat"); |
| 41 | if (icon_file != nullptr) { | 41 | if (icon_file != nullptr) { |
| 42 | icon_data = icon_file->ReadAllBytes(); | 42 | icon_data = icon_file->ReadAllBytes(); |
| 43 | break; | 43 | break; |
| @@ -46,7 +46,7 @@ AppLoader_DeconstructedRomDirectory::AppLoader_DeconstructedRomDirectory(FileSys | |||
| 46 | 46 | ||
| 47 | if (icon_data.empty()) { | 47 | if (icon_data.empty()) { |
| 48 | // Any png, jpeg, or bmp file | 48 | // Any png, jpeg, or bmp file |
| 49 | const auto& files = dir->GetFiles(); | 49 | const auto& files = file_dir->GetFiles(); |
| 50 | const auto icon_iter = | 50 | const auto icon_iter = |
| 51 | std::find_if(files.begin(), files.end(), [](const FileSys::VirtualFile& file) { | 51 | std::find_if(files.begin(), files.end(), [](const FileSys::VirtualFile& file) { |
| 52 | return file->GetExtension() == "png" || file->GetExtension() == "jpg" || | 52 | return file->GetExtension() == "png" || file->GetExtension() == "jpg" || |
| @@ -57,9 +57,9 @@ AppLoader_DeconstructedRomDirectory::AppLoader_DeconstructedRomDirectory(FileSys | |||
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | // Metadata | 59 | // Metadata |
| 60 | FileSys::VirtualFile nacp_file = dir->GetFile("control.nacp"); | 60 | FileSys::VirtualFile nacp_file = file_dir->GetFile("control.nacp"); |
| 61 | if (nacp_file == nullptr) { | 61 | if (nacp_file == nullptr) { |
| 62 | const auto& files = dir->GetFiles(); | 62 | const auto& files = file_dir->GetFiles(); |
| 63 | const auto nacp_iter = | 63 | const auto nacp_iter = |
| 64 | std::find_if(files.begin(), files.end(), [](const FileSys::VirtualFile& file) { | 64 | std::find_if(files.begin(), files.end(), [](const FileSys::VirtualFile& file) { |
| 65 | return file->GetExtension() == "nacp"; | 65 | return file->GetExtension() == "nacp"; |
| @@ -200,17 +200,21 @@ AppLoader_DeconstructedRomDirectory::LoadResult AppLoader_DeconstructedRomDirect | |||
| 200 | LoadParameters{metadata.GetMainThreadPriority(), metadata.GetMainThreadStackSize()}}; | 200 | LoadParameters{metadata.GetMainThreadPriority(), metadata.GetMainThreadStackSize()}}; |
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | ResultStatus AppLoader_DeconstructedRomDirectory::ReadRomFS(FileSys::VirtualFile& dir) { | 203 | ResultStatus AppLoader_DeconstructedRomDirectory::ReadRomFS(FileSys::VirtualFile& out_dir) { |
| 204 | if (romfs == nullptr) | 204 | if (romfs == nullptr) { |
| 205 | return ResultStatus::ErrorNoRomFS; | 205 | return ResultStatus::ErrorNoRomFS; |
| 206 | dir = romfs; | 206 | } |
| 207 | |||
| 208 | out_dir = romfs; | ||
| 207 | return ResultStatus::Success; | 209 | return ResultStatus::Success; |
| 208 | } | 210 | } |
| 209 | 211 | ||
| 210 | ResultStatus AppLoader_DeconstructedRomDirectory::ReadIcon(std::vector<u8>& buffer) { | 212 | ResultStatus AppLoader_DeconstructedRomDirectory::ReadIcon(std::vector<u8>& out_buffer) { |
| 211 | if (icon_data.empty()) | 213 | if (icon_data.empty()) { |
| 212 | return ResultStatus::ErrorNoIcon; | 214 | return ResultStatus::ErrorNoIcon; |
| 213 | buffer = icon_data; | 215 | } |
| 216 | |||
| 217 | out_buffer = icon_data; | ||
| 214 | return ResultStatus::Success; | 218 | return ResultStatus::Success; |
| 215 | } | 219 | } |
| 216 | 220 | ||
| @@ -219,10 +223,12 @@ ResultStatus AppLoader_DeconstructedRomDirectory::ReadProgramId(u64& out_program | |||
| 219 | return ResultStatus::Success; | 223 | return ResultStatus::Success; |
| 220 | } | 224 | } |
| 221 | 225 | ||
| 222 | ResultStatus AppLoader_DeconstructedRomDirectory::ReadTitle(std::string& title) { | 226 | ResultStatus AppLoader_DeconstructedRomDirectory::ReadTitle(std::string& out_title) { |
| 223 | if (name.empty()) | 227 | if (name.empty()) { |
| 224 | return ResultStatus::ErrorNoControl; | 228 | return ResultStatus::ErrorNoControl; |
| 225 | title = name; | 229 | } |
| 230 | |||
| 231 | out_title = name; | ||
| 226 | return ResultStatus::Success; | 232 | return ResultStatus::Success; |
| 227 | } | 233 | } |
| 228 | 234 | ||
| @@ -230,12 +236,12 @@ bool AppLoader_DeconstructedRomDirectory::IsRomFSUpdatable() const { | |||
| 230 | return false; | 236 | return false; |
| 231 | } | 237 | } |
| 232 | 238 | ||
| 233 | ResultStatus AppLoader_DeconstructedRomDirectory::ReadNSOModules(Modules& modules) { | 239 | ResultStatus AppLoader_DeconstructedRomDirectory::ReadNSOModules(Modules& out_modules) { |
| 234 | if (!is_loaded) { | 240 | if (!is_loaded) { |
| 235 | return ResultStatus::ErrorNotInitialized; | 241 | return ResultStatus::ErrorNotInitialized; |
| 236 | } | 242 | } |
| 237 | 243 | ||
| 238 | modules = this->modules; | 244 | out_modules = this->modules; |
| 239 | return ResultStatus::Success; | 245 | return ResultStatus::Success; |
| 240 | } | 246 | } |
| 241 | 247 | ||
diff --git a/src/core/loader/deconstructed_rom_directory.h b/src/core/loader/deconstructed_rom_directory.h index 3c968580f..c2b46e1bf 100644 --- a/src/core/loader/deconstructed_rom_directory.h +++ b/src/core/loader/deconstructed_rom_directory.h | |||
| @@ -43,13 +43,13 @@ public: | |||
| 43 | 43 | ||
| 44 | LoadResult Load(Kernel::Process& process, Core::System& system) override; | 44 | LoadResult Load(Kernel::Process& process, Core::System& system) override; |
| 45 | 45 | ||
| 46 | ResultStatus ReadRomFS(FileSys::VirtualFile& dir) override; | 46 | ResultStatus ReadRomFS(FileSys::VirtualFile& out_dir) override; |
| 47 | ResultStatus ReadIcon(std::vector<u8>& buffer) override; | 47 | ResultStatus ReadIcon(std::vector<u8>& out_buffer) override; |
| 48 | ResultStatus ReadProgramId(u64& out_program_id) override; | 48 | ResultStatus ReadProgramId(u64& out_program_id) override; |
| 49 | ResultStatus ReadTitle(std::string& title) override; | 49 | ResultStatus ReadTitle(std::string& title) override; |
| 50 | bool IsRomFSUpdatable() const override; | 50 | bool IsRomFSUpdatable() const override; |
| 51 | 51 | ||
| 52 | ResultStatus ReadNSOModules(Modules& modules) override; | 52 | ResultStatus ReadNSOModules(Modules& out_modules) override; |
| 53 | 53 | ||
| 54 | private: | 54 | private: |
| 55 | FileSys::ProgramMetadata metadata; | 55 | FileSys::ProgramMetadata metadata; |
diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index f4a339390..627c18c7e 100644 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp | |||
| @@ -364,21 +364,24 @@ SectionID ElfReader::GetSectionByName(const char* name, int firstSection) const | |||
| 364 | 364 | ||
| 365 | namespace Loader { | 365 | namespace Loader { |
| 366 | 366 | ||
| 367 | AppLoader_ELF::AppLoader_ELF(FileSys::VirtualFile file) : AppLoader(std::move(file)) {} | 367 | AppLoader_ELF::AppLoader_ELF(FileSys::VirtualFile file_) : AppLoader(std::move(file_)) {} |
| 368 | 368 | ||
| 369 | FileType AppLoader_ELF::IdentifyType(const FileSys::VirtualFile& file) { | 369 | FileType AppLoader_ELF::IdentifyType(const FileSys::VirtualFile& elf_file) { |
| 370 | static constexpr u16 ELF_MACHINE_ARM{0x28}; | 370 | static constexpr u16 ELF_MACHINE_ARM{0x28}; |
| 371 | 371 | ||
| 372 | u32 magic = 0; | 372 | u32 magic = 0; |
| 373 | if (4 != file->ReadObject(&magic)) | 373 | if (4 != elf_file->ReadObject(&magic)) { |
| 374 | return FileType::Error; | 374 | return FileType::Error; |
| 375 | } | ||
| 375 | 376 | ||
| 376 | u16 machine = 0; | 377 | u16 machine = 0; |
| 377 | if (2 != file->ReadObject(&machine, 18)) | 378 | if (2 != elf_file->ReadObject(&machine, 18)) { |
| 378 | return FileType::Error; | 379 | return FileType::Error; |
| 380 | } | ||
| 379 | 381 | ||
| 380 | if (Common::MakeMagic('\x7f', 'E', 'L', 'F') == magic && ELF_MACHINE_ARM == machine) | 382 | if (Common::MakeMagic('\x7f', 'E', 'L', 'F') == magic && ELF_MACHINE_ARM == machine) { |
| 381 | return FileType::ELF; | 383 | return FileType::ELF; |
| 384 | } | ||
| 382 | 385 | ||
| 383 | return FileType::Error; | 386 | return FileType::Error; |
| 384 | } | 387 | } |
diff --git a/src/core/loader/elf.h b/src/core/loader/elf.h index 2067932c7..2b86c0b49 100644 --- a/src/core/loader/elf.h +++ b/src/core/loader/elf.h | |||
| @@ -20,11 +20,13 @@ public: | |||
| 20 | explicit AppLoader_ELF(FileSys::VirtualFile file); | 20 | explicit AppLoader_ELF(FileSys::VirtualFile file); |
| 21 | 21 | ||
| 22 | /** | 22 | /** |
| 23 | * Returns the type of the file | 23 | * Identifies whether or not the given file is an ELF file. |
| 24 | * @param file open file | 24 | * |
| 25 | * @return FileType found, or FileType::Error if this loader doesn't know it | 25 | * @param elf_file The file to identify. |
| 26 | * | ||
| 27 | * @return FileType::ELF, or FileType::Error if the file is not an ELF file. | ||
| 26 | */ | 28 | */ |
| 27 | static FileType IdentifyType(const FileSys::VirtualFile& file); | 29 | static FileType IdentifyType(const FileSys::VirtualFile& elf_file); |
| 28 | 30 | ||
| 29 | FileType GetFileType() const override { | 31 | FileType GetFileType() const override { |
| 30 | return IdentifyType(file); | 32 | return IdentifyType(file); |
diff --git a/src/core/loader/kip.cpp b/src/core/loader/kip.cpp index 3f4ba233d..9b447da2a 100644 --- a/src/core/loader/kip.cpp +++ b/src/core/loader/kip.cpp | |||
| @@ -24,9 +24,9 @@ AppLoader_KIP::AppLoader_KIP(FileSys::VirtualFile file_) | |||
| 24 | 24 | ||
| 25 | AppLoader_KIP::~AppLoader_KIP() = default; | 25 | AppLoader_KIP::~AppLoader_KIP() = default; |
| 26 | 26 | ||
| 27 | FileType AppLoader_KIP::IdentifyType(const FileSys::VirtualFile& file) { | 27 | FileType AppLoader_KIP::IdentifyType(const FileSys::VirtualFile& in_file) { |
| 28 | u32_le magic{}; | 28 | u32_le magic{}; |
| 29 | if (file->GetSize() < sizeof(u32) || file->ReadObject(&magic) != sizeof(u32)) { | 29 | if (in_file->GetSize() < sizeof(u32) || in_file->ReadObject(&magic) != sizeof(u32)) { |
| 30 | return FileType::Error; | 30 | return FileType::Error; |
| 31 | } | 31 | } |
| 32 | 32 | ||
| @@ -56,10 +56,10 @@ AppLoader::LoadResult AppLoader_KIP::Load(Kernel::Process& process, | |||
| 56 | return {kip->GetStatus(), {}}; | 56 | return {kip->GetStatus(), {}}; |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | const auto get_kip_address_space_type = [](const auto& kip) { | 59 | const auto get_kip_address_space_type = [](const auto& kip_type) { |
| 60 | return kip.Is64Bit() | 60 | return kip_type.Is64Bit() |
| 61 | ? (kip.Is39BitAddressSpace() ? FileSys::ProgramAddressSpaceType::Is39Bit | 61 | ? (kip_type.Is39BitAddressSpace() ? FileSys::ProgramAddressSpaceType::Is39Bit |
| 62 | : FileSys::ProgramAddressSpaceType::Is36Bit) | 62 | : FileSys::ProgramAddressSpaceType::Is36Bit) |
| 63 | : FileSys::ProgramAddressSpaceType::Is32Bit; | 63 | : FileSys::ProgramAddressSpaceType::Is32Bit; |
| 64 | }; | 64 | }; |
| 65 | 65 | ||
| @@ -68,7 +68,8 @@ AppLoader::LoadResult AppLoader_KIP::Load(Kernel::Process& process, | |||
| 68 | FileSys::ProgramMetadata metadata; | 68 | FileSys::ProgramMetadata metadata; |
| 69 | metadata.LoadManual(kip->Is64Bit(), address_space, kip->GetMainThreadPriority(), | 69 | metadata.LoadManual(kip->Is64Bit(), address_space, kip->GetMainThreadPriority(), |
| 70 | kip->GetMainThreadCpuCore(), kip->GetMainThreadStackSize(), | 70 | kip->GetMainThreadCpuCore(), kip->GetMainThreadStackSize(), |
| 71 | kip->GetTitleID(), 0xFFFFFFFFFFFFFFFF, kip->GetKernelCapabilities()); | 71 | kip->GetTitleID(), 0xFFFFFFFFFFFFFFFF, 0x1FE00000, |
| 72 | kip->GetKernelCapabilities()); | ||
| 72 | 73 | ||
| 73 | const VAddr base_address = process.PageTable().GetCodeRegionStart(); | 74 | const VAddr base_address = process.PageTable().GetCodeRegionStart(); |
| 74 | Kernel::CodeSet codeset; | 75 | Kernel::CodeSet codeset; |
diff --git a/src/core/loader/kip.h b/src/core/loader/kip.h index 14a85e295..2fe636f01 100644 --- a/src/core/loader/kip.h +++ b/src/core/loader/kip.h | |||
| @@ -22,11 +22,13 @@ public: | |||
| 22 | ~AppLoader_KIP() override; | 22 | ~AppLoader_KIP() override; |
| 23 | 23 | ||
| 24 | /** | 24 | /** |
| 25 | * Returns the type of the file | 25 | * Identifies whether or not the given file is a KIP. |
| 26 | * @param file open file | 26 | * |
| 27 | * @return FileType found, or FileType::Error if this loader doesn't know it | 27 | * @param in_file The file to identify. |
| 28 | * | ||
| 29 | * @return FileType::KIP if found, or FileType::Error if unknown. | ||
| 28 | */ | 30 | */ |
| 29 | static FileType IdentifyType(const FileSys::VirtualFile& file); | 31 | static FileType IdentifyType(const FileSys::VirtualFile& in_file); |
| 30 | 32 | ||
| 31 | FileType GetFileType() const override; | 33 | FileType GetFileType() const override; |
| 32 | 34 | ||
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h index b2e5b13de..bf6db1ab1 100644 --- a/src/core/loader/loader.h +++ b/src/core/loader/loader.h | |||
| @@ -152,21 +152,26 @@ public: | |||
| 152 | 152 | ||
| 153 | /** | 153 | /** |
| 154 | * Returns the type of this file | 154 | * Returns the type of this file |
| 155 | * | ||
| 155 | * @return FileType corresponding to the loaded file | 156 | * @return FileType corresponding to the loaded file |
| 156 | */ | 157 | */ |
| 157 | virtual FileType GetFileType() const = 0; | 158 | virtual FileType GetFileType() const = 0; |
| 158 | 159 | ||
| 159 | /** | 160 | /** |
| 160 | * Load the application and return the created Process instance | 161 | * Load the application and return the created Process instance |
| 162 | * | ||
| 161 | * @param process The newly created process. | 163 | * @param process The newly created process. |
| 162 | * @param system The system that this process is being loaded under. | 164 | * @param system The system that this process is being loaded under. |
| 165 | * | ||
| 163 | * @return The status result of the operation. | 166 | * @return The status result of the operation. |
| 164 | */ | 167 | */ |
| 165 | virtual LoadResult Load(Kernel::Process& process, Core::System& system) = 0; | 168 | virtual LoadResult Load(Kernel::Process& process, Core::System& system) = 0; |
| 166 | 169 | ||
| 167 | /** | 170 | /** |
| 168 | * Get the code (typically .code section) of the application | 171 | * Get the code (typically .code section) of the application |
| 169 | * @param buffer Reference to buffer to store data | 172 | * |
| 173 | * @param[out] buffer Reference to buffer to store data | ||
| 174 | * | ||
| 170 | * @return ResultStatus result of function | 175 | * @return ResultStatus result of function |
| 171 | */ | 176 | */ |
| 172 | virtual ResultStatus ReadCode(std::vector<u8>& buffer) { | 177 | virtual ResultStatus ReadCode(std::vector<u8>& buffer) { |
| @@ -175,7 +180,9 @@ public: | |||
| 175 | 180 | ||
| 176 | /** | 181 | /** |
| 177 | * Get the icon (typically icon section) of the application | 182 | * Get the icon (typically icon section) of the application |
| 178 | * @param buffer Reference to buffer to store data | 183 | * |
| 184 | * @param[out] buffer Reference to buffer to store data | ||
| 185 | * | ||
| 179 | * @return ResultStatus result of function | 186 | * @return ResultStatus result of function |
| 180 | */ | 187 | */ |
| 181 | virtual ResultStatus ReadIcon(std::vector<u8>& buffer) { | 188 | virtual ResultStatus ReadIcon(std::vector<u8>& buffer) { |
| @@ -186,7 +193,9 @@ public: | |||
| 186 | * Get the banner (typically banner section) of the application | 193 | * Get the banner (typically banner section) of the application |
| 187 | * In the context of NX, this is the animation that displays in the bottom right of the screen | 194 | * In the context of NX, this is the animation that displays in the bottom right of the screen |
| 188 | * when a game boots. Stored in GIF format. | 195 | * when a game boots. Stored in GIF format. |
| 189 | * @param buffer Reference to buffer to store data | 196 | * |
| 197 | * @param[out] buffer Reference to buffer to store data | ||
| 198 | * | ||
| 190 | * @return ResultStatus result of function | 199 | * @return ResultStatus result of function |
| 191 | */ | 200 | */ |
| 192 | virtual ResultStatus ReadBanner(std::vector<u8>& buffer) { | 201 | virtual ResultStatus ReadBanner(std::vector<u8>& buffer) { |
| @@ -197,7 +206,9 @@ public: | |||
| 197 | * Get the logo (typically logo section) of the application | 206 | * Get the logo (typically logo section) of the application |
| 198 | * In the context of NX, this is the static image that displays in the top left of the screen | 207 | * In the context of NX, this is the static image that displays in the top left of the screen |
| 199 | * when a game boots. Stored in JPEG format. | 208 | * when a game boots. Stored in JPEG format. |
| 200 | * @param buffer Reference to buffer to store data | 209 | * |
| 210 | * @param[out] buffer Reference to buffer to store data | ||
| 211 | * | ||
| 201 | * @return ResultStatus result of function | 212 | * @return ResultStatus result of function |
| 202 | */ | 213 | */ |
| 203 | virtual ResultStatus ReadLogo(std::vector<u8>& buffer) { | 214 | virtual ResultStatus ReadLogo(std::vector<u8>& buffer) { |
| @@ -206,7 +217,9 @@ public: | |||
| 206 | 217 | ||
| 207 | /** | 218 | /** |
| 208 | * Get the program id of the application | 219 | * Get the program id of the application |
| 209 | * @param out_program_id Reference to store program id into | 220 | * |
| 221 | * @param[out] out_program_id Reference to store program id into | ||
| 222 | * | ||
| 210 | * @return ResultStatus result of function | 223 | * @return ResultStatus result of function |
| 211 | */ | 224 | */ |
| 212 | virtual ResultStatus ReadProgramId(u64& out_program_id) { | 225 | virtual ResultStatus ReadProgramId(u64& out_program_id) { |
| @@ -216,19 +229,23 @@ public: | |||
| 216 | /** | 229 | /** |
| 217 | * Get the RomFS of the application | 230 | * Get the RomFS of the application |
| 218 | * Since the RomFS can be huge, we return a file reference instead of copying to a buffer | 231 | * Since the RomFS can be huge, we return a file reference instead of copying to a buffer |
| 219 | * @param file The directory containing the RomFS | 232 | * |
| 233 | * @param[out] out_file The directory containing the RomFS | ||
| 234 | * | ||
| 220 | * @return ResultStatus result of function | 235 | * @return ResultStatus result of function |
| 221 | */ | 236 | */ |
| 222 | virtual ResultStatus ReadRomFS(FileSys::VirtualFile& file) { | 237 | virtual ResultStatus ReadRomFS(FileSys::VirtualFile& out_file) { |
| 223 | return ResultStatus::ErrorNotImplemented; | 238 | return ResultStatus::ErrorNotImplemented; |
| 224 | } | 239 | } |
| 225 | 240 | ||
| 226 | /** | 241 | /** |
| 227 | * Get the raw update of the application, should it come packed with one | 242 | * Get the raw update of the application, should it come packed with one |
| 228 | * @param file The raw update NCA file (Program-type | 243 | * |
| 244 | * @param[out] out_file The raw update NCA file (Program-type) | ||
| 245 | * | ||
| 229 | * @return ResultStatus result of function | 246 | * @return ResultStatus result of function |
| 230 | */ | 247 | */ |
| 231 | virtual ResultStatus ReadUpdateRaw(FileSys::VirtualFile& file) { | 248 | virtual ResultStatus ReadUpdateRaw(FileSys::VirtualFile& out_file) { |
| 232 | return ResultStatus::ErrorNotImplemented; | 249 | return ResultStatus::ErrorNotImplemented; |
| 233 | } | 250 | } |
| 234 | 251 | ||
| @@ -236,7 +253,8 @@ public: | |||
| 236 | * Get whether or not updates can be applied to the RomFS. | 253 | * Get whether or not updates can be applied to the RomFS. |
| 237 | * By default, this is true, however for formats where it cannot be guaranteed that the RomFS is | 254 | * By default, this is true, however for formats where it cannot be guaranteed that the RomFS is |
| 238 | * the base game it should be set to false. | 255 | * the base game it should be set to false. |
| 239 | * @return bool whether or not updatable. | 256 | * |
| 257 | * @return bool indicating whether or not the RomFS is updatable. | ||
| 240 | */ | 258 | */ |
| 241 | virtual bool IsRomFSUpdatable() const { | 259 | virtual bool IsRomFSUpdatable() const { |
| 242 | return true; | 260 | return true; |
| @@ -244,8 +262,9 @@ public: | |||
| 244 | 262 | ||
| 245 | /** | 263 | /** |
| 246 | * Gets the difference between the start of the IVFC header and the start of level 6 (RomFS) | 264 | * Gets the difference between the start of the IVFC header and the start of level 6 (RomFS) |
| 247 | * data. Needed for bktr patching. | 265 | * data. Needed for BKTR patching. |
| 248 | * @return IVFC offset for romfs. | 266 | * |
| 267 | * @return IVFC offset for RomFS. | ||
| 249 | */ | 268 | */ |
| 250 | virtual u64 ReadRomFSIVFCOffset() const { | 269 | virtual u64 ReadRomFSIVFCOffset() const { |
| 251 | return 0; | 270 | return 0; |
| @@ -253,7 +272,9 @@ public: | |||
| 253 | 272 | ||
| 254 | /** | 273 | /** |
| 255 | * Get the title of the application | 274 | * Get the title of the application |
| 256 | * @param title Reference to store the application title into | 275 | * |
| 276 | * @param[out] title Reference to store the application title into | ||
| 277 | * | ||
| 257 | * @return ResultStatus result of function | 278 | * @return ResultStatus result of function |
| 258 | */ | 279 | */ |
| 259 | virtual ResultStatus ReadTitle(std::string& title) { | 280 | virtual ResultStatus ReadTitle(std::string& title) { |
| @@ -262,7 +283,9 @@ public: | |||
| 262 | 283 | ||
| 263 | /** | 284 | /** |
| 264 | * Get the control data (CNMT) of the application | 285 | * Get the control data (CNMT) of the application |
| 265 | * @param control Reference to store the application control data into | 286 | * |
| 287 | * @param[out] control Reference to store the application control data into | ||
| 288 | * | ||
| 266 | * @return ResultStatus result of function | 289 | * @return ResultStatus result of function |
| 267 | */ | 290 | */ |
| 268 | virtual ResultStatus ReadControlData(FileSys::NACP& control) { | 291 | virtual ResultStatus ReadControlData(FileSys::NACP& control) { |
| @@ -271,10 +294,12 @@ public: | |||
| 271 | 294 | ||
| 272 | /** | 295 | /** |
| 273 | * Get the RomFS of the manual of the application | 296 | * Get the RomFS of the manual of the application |
| 274 | * @param file The raw manual RomFS of the game | 297 | * |
| 298 | * @param[out] out_file The raw manual RomFS of the game | ||
| 299 | * | ||
| 275 | * @return ResultStatus result of function | 300 | * @return ResultStatus result of function |
| 276 | */ | 301 | */ |
| 277 | virtual ResultStatus ReadManualRomFS(FileSys::VirtualFile& file) { | 302 | virtual ResultStatus ReadManualRomFS(FileSys::VirtualFile& out_file) { |
| 278 | return ResultStatus::ErrorNotImplemented; | 303 | return ResultStatus::ErrorNotImplemented; |
| 279 | } | 304 | } |
| 280 | 305 | ||
diff --git a/src/core/loader/nax.cpp b/src/core/loader/nax.cpp index 49028177b..f53c3a72c 100644 --- a/src/core/loader/nax.cpp +++ b/src/core/loader/nax.cpp | |||
| @@ -26,14 +26,14 @@ FileType IdentifyTypeImpl(const FileSys::NAX& nax) { | |||
| 26 | } | 26 | } |
| 27 | } // Anonymous namespace | 27 | } // Anonymous namespace |
| 28 | 28 | ||
| 29 | AppLoader_NAX::AppLoader_NAX(FileSys::VirtualFile file) | 29 | AppLoader_NAX::AppLoader_NAX(FileSys::VirtualFile file_) |
| 30 | : AppLoader(file), nax(std::make_unique<FileSys::NAX>(file)), | 30 | : AppLoader(file_), nax(std::make_unique<FileSys::NAX>(file_)), |
| 31 | nca_loader(std::make_unique<AppLoader_NCA>(nax->GetDecrypted())) {} | 31 | nca_loader(std::make_unique<AppLoader_NCA>(nax->GetDecrypted())) {} |
| 32 | 32 | ||
| 33 | AppLoader_NAX::~AppLoader_NAX() = default; | 33 | AppLoader_NAX::~AppLoader_NAX() = default; |
| 34 | 34 | ||
| 35 | FileType AppLoader_NAX::IdentifyType(const FileSys::VirtualFile& file) { | 35 | FileType AppLoader_NAX::IdentifyType(const FileSys::VirtualFile& nax_file) { |
| 36 | const FileSys::NAX nax(file); | 36 | const FileSys::NAX nax(nax_file); |
| 37 | return IdentifyTypeImpl(nax); | 37 | return IdentifyTypeImpl(nax); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| @@ -41,8 +41,7 @@ FileType AppLoader_NAX::GetFileType() const { | |||
| 41 | return IdentifyTypeImpl(*nax); | 41 | return IdentifyTypeImpl(*nax); |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | AppLoader_NAX::LoadResult AppLoader_NAX::Load(Kernel::Process& process, | 44 | AppLoader_NAX::LoadResult AppLoader_NAX::Load(Kernel::Process& process, Core::System& system) { |
| 45 | [[maybe_unused]] Core::System& system) { | ||
| 46 | if (is_loaded) { | 45 | if (is_loaded) { |
| 47 | return {ResultStatus::ErrorAlreadyLoaded, {}}; | 46 | return {ResultStatus::ErrorAlreadyLoaded, {}}; |
| 48 | } | 47 | } |
diff --git a/src/core/loader/nax.h b/src/core/loader/nax.h index a5b5e2ae1..68427c1cf 100644 --- a/src/core/loader/nax.h +++ b/src/core/loader/nax.h | |||
| @@ -23,15 +23,17 @@ class AppLoader_NCA; | |||
| 23 | /// Loads a NAX file | 23 | /// Loads a NAX file |
| 24 | class AppLoader_NAX final : public AppLoader { | 24 | class AppLoader_NAX final : public AppLoader { |
| 25 | public: | 25 | public: |
| 26 | explicit AppLoader_NAX(FileSys::VirtualFile file); | 26 | explicit AppLoader_NAX(FileSys::VirtualFile file_); |
| 27 | ~AppLoader_NAX() override; | 27 | ~AppLoader_NAX() override; |
| 28 | 28 | ||
| 29 | /** | 29 | /** |
| 30 | * Returns the type of the file | 30 | * Identifies whether or not the given file is a NAX file. |
| 31 | * @param file open file | 31 | * |
| 32 | * @return FileType found, or FileType::Error if this loader doesn't know it | 32 | * @param nax_file The file to identify. |
| 33 | * | ||
| 34 | * @return FileType::NAX, or FileType::Error if the file is not a NAX file. | ||
| 33 | */ | 35 | */ |
| 34 | static FileType IdentifyType(const FileSys::VirtualFile& file); | 36 | static FileType IdentifyType(const FileSys::VirtualFile& nax_file); |
| 35 | 37 | ||
| 36 | FileType GetFileType() const override; | 38 | FileType GetFileType() const override; |
| 37 | 39 | ||
diff --git a/src/core/loader/nca.cpp b/src/core/loader/nca.cpp index fa694de37..47e7a77a9 100644 --- a/src/core/loader/nca.cpp +++ b/src/core/loader/nca.cpp | |||
| @@ -21,12 +21,13 @@ AppLoader_NCA::AppLoader_NCA(FileSys::VirtualFile file_) | |||
| 21 | 21 | ||
| 22 | AppLoader_NCA::~AppLoader_NCA() = default; | 22 | AppLoader_NCA::~AppLoader_NCA() = default; |
| 23 | 23 | ||
| 24 | FileType AppLoader_NCA::IdentifyType(const FileSys::VirtualFile& file) { | 24 | FileType AppLoader_NCA::IdentifyType(const FileSys::VirtualFile& nca_file) { |
| 25 | FileSys::NCA nca(file); | 25 | const FileSys::NCA nca(nca_file); |
| 26 | 26 | ||
| 27 | if (nca.GetStatus() == ResultStatus::Success && | 27 | if (nca.GetStatus() == ResultStatus::Success && |
| 28 | nca.GetType() == FileSys::NCAContentType::Program) | 28 | nca.GetType() == FileSys::NCAContentType::Program) { |
| 29 | return FileType::NCA; | 29 | return FileType::NCA; |
| 30 | } | ||
| 30 | 31 | ||
| 31 | return FileType::Error; | 32 | return FileType::Error; |
| 32 | } | 33 | } |
| @@ -67,43 +68,59 @@ AppLoader_NCA::LoadResult AppLoader_NCA::Load(Kernel::Process& process, Core::Sy | |||
| 67 | } | 68 | } |
| 68 | 69 | ||
| 69 | ResultStatus AppLoader_NCA::ReadRomFS(FileSys::VirtualFile& dir) { | 70 | ResultStatus AppLoader_NCA::ReadRomFS(FileSys::VirtualFile& dir) { |
| 70 | if (nca == nullptr) | 71 | if (nca == nullptr) { |
| 71 | return ResultStatus::ErrorNotInitialized; | 72 | return ResultStatus::ErrorNotInitialized; |
| 72 | if (nca->GetRomFS() == nullptr || nca->GetRomFS()->GetSize() == 0) | 73 | } |
| 74 | |||
| 75 | if (nca->GetRomFS() == nullptr || nca->GetRomFS()->GetSize() == 0) { | ||
| 73 | return ResultStatus::ErrorNoRomFS; | 76 | return ResultStatus::ErrorNoRomFS; |
| 77 | } | ||
| 78 | |||
| 74 | dir = nca->GetRomFS(); | 79 | dir = nca->GetRomFS(); |
| 75 | return ResultStatus::Success; | 80 | return ResultStatus::Success; |
| 76 | } | 81 | } |
| 77 | 82 | ||
| 78 | u64 AppLoader_NCA::ReadRomFSIVFCOffset() const { | 83 | u64 AppLoader_NCA::ReadRomFSIVFCOffset() const { |
| 79 | if (nca == nullptr) | 84 | if (nca == nullptr) { |
| 80 | return 0; | 85 | return 0; |
| 86 | } | ||
| 87 | |||
| 81 | return nca->GetBaseIVFCOffset(); | 88 | return nca->GetBaseIVFCOffset(); |
| 82 | } | 89 | } |
| 83 | 90 | ||
| 84 | ResultStatus AppLoader_NCA::ReadProgramId(u64& out_program_id) { | 91 | ResultStatus AppLoader_NCA::ReadProgramId(u64& out_program_id) { |
| 85 | if (nca == nullptr || nca->GetStatus() != ResultStatus::Success) | 92 | if (nca == nullptr || nca->GetStatus() != ResultStatus::Success) { |
| 86 | return ResultStatus::ErrorNotInitialized; | 93 | return ResultStatus::ErrorNotInitialized; |
| 94 | } | ||
| 95 | |||
| 87 | out_program_id = nca->GetTitleId(); | 96 | out_program_id = nca->GetTitleId(); |
| 88 | return ResultStatus::Success; | 97 | return ResultStatus::Success; |
| 89 | } | 98 | } |
| 90 | 99 | ||
| 91 | ResultStatus AppLoader_NCA::ReadBanner(std::vector<u8>& buffer) { | 100 | ResultStatus AppLoader_NCA::ReadBanner(std::vector<u8>& buffer) { |
| 92 | if (nca == nullptr || nca->GetStatus() != ResultStatus::Success) | 101 | if (nca == nullptr || nca->GetStatus() != ResultStatus::Success) { |
| 93 | return ResultStatus::ErrorNotInitialized; | 102 | return ResultStatus::ErrorNotInitialized; |
| 103 | } | ||
| 104 | |||
| 94 | const auto logo = nca->GetLogoPartition(); | 105 | const auto logo = nca->GetLogoPartition(); |
| 95 | if (logo == nullptr) | 106 | if (logo == nullptr) { |
| 96 | return ResultStatus::ErrorNoIcon; | 107 | return ResultStatus::ErrorNoIcon; |
| 108 | } | ||
| 109 | |||
| 97 | buffer = logo->GetFile("StartupMovie.gif")->ReadAllBytes(); | 110 | buffer = logo->GetFile("StartupMovie.gif")->ReadAllBytes(); |
| 98 | return ResultStatus::Success; | 111 | return ResultStatus::Success; |
| 99 | } | 112 | } |
| 100 | 113 | ||
| 101 | ResultStatus AppLoader_NCA::ReadLogo(std::vector<u8>& buffer) { | 114 | ResultStatus AppLoader_NCA::ReadLogo(std::vector<u8>& buffer) { |
| 102 | if (nca == nullptr || nca->GetStatus() != ResultStatus::Success) | 115 | if (nca == nullptr || nca->GetStatus() != ResultStatus::Success) { |
| 103 | return ResultStatus::ErrorNotInitialized; | 116 | return ResultStatus::ErrorNotInitialized; |
| 117 | } | ||
| 118 | |||
| 104 | const auto logo = nca->GetLogoPartition(); | 119 | const auto logo = nca->GetLogoPartition(); |
| 105 | if (logo == nullptr) | 120 | if (logo == nullptr) { |
| 106 | return ResultStatus::ErrorNoIcon; | 121 | return ResultStatus::ErrorNoIcon; |
| 122 | } | ||
| 123 | |||
| 107 | buffer = logo->GetFile("NintendoLogo.png")->ReadAllBytes(); | 124 | buffer = logo->GetFile("NintendoLogo.png")->ReadAllBytes(); |
| 108 | return ResultStatus::Success; | 125 | return ResultStatus::Success; |
| 109 | } | 126 | } |
diff --git a/src/core/loader/nca.h b/src/core/loader/nca.h index 918792800..c9792f390 100644 --- a/src/core/loader/nca.h +++ b/src/core/loader/nca.h | |||
| @@ -23,15 +23,17 @@ class AppLoader_DeconstructedRomDirectory; | |||
| 23 | /// Loads an NCA file | 23 | /// Loads an NCA file |
| 24 | class AppLoader_NCA final : public AppLoader { | 24 | class AppLoader_NCA final : public AppLoader { |
| 25 | public: | 25 | public: |
| 26 | explicit AppLoader_NCA(FileSys::VirtualFile file); | 26 | explicit AppLoader_NCA(FileSys::VirtualFile file_); |
| 27 | ~AppLoader_NCA() override; | 27 | ~AppLoader_NCA() override; |
| 28 | 28 | ||
| 29 | /** | 29 | /** |
| 30 | * Returns the type of the file | 30 | * Identifies whether or not the given file is an NCA file. |
| 31 | * @param file open file | 31 | * |
| 32 | * @return FileType found, or FileType::Error if this loader doesn't know it | 32 | * @param nca_file The file to identify. |
| 33 | * | ||
| 34 | * @return FileType::NCA, or FileType::Error if the file is not an NCA file. | ||
| 33 | */ | 35 | */ |
| 34 | static FileType IdentifyType(const FileSys::VirtualFile& file); | 36 | static FileType IdentifyType(const FileSys::VirtualFile& nca_file); |
| 35 | 37 | ||
| 36 | FileType GetFileType() const override { | 38 | FileType GetFileType() const override { |
| 37 | return IdentifyType(file); | 39 | return IdentifyType(file); |
diff --git a/src/core/loader/nro.cpp b/src/core/loader/nro.cpp index 0115ed0c4..0597cfa60 100644 --- a/src/core/loader/nro.cpp +++ b/src/core/loader/nro.cpp | |||
| @@ -72,7 +72,7 @@ struct AssetHeader { | |||
| 72 | }; | 72 | }; |
| 73 | static_assert(sizeof(AssetHeader) == 0x38, "AssetHeader has incorrect size."); | 73 | static_assert(sizeof(AssetHeader) == 0x38, "AssetHeader has incorrect size."); |
| 74 | 74 | ||
| 75 | AppLoader_NRO::AppLoader_NRO(FileSys::VirtualFile file) : AppLoader(file) { | 75 | AppLoader_NRO::AppLoader_NRO(FileSys::VirtualFile file_) : AppLoader(std::move(file_)) { |
| 76 | NroHeader nro_header{}; | 76 | NroHeader nro_header{}; |
| 77 | if (file->ReadObject(&nro_header) != sizeof(NroHeader)) { | 77 | if (file->ReadObject(&nro_header) != sizeof(NroHeader)) { |
| 78 | return; | 78 | return; |
| @@ -114,10 +114,10 @@ AppLoader_NRO::AppLoader_NRO(FileSys::VirtualFile file) : AppLoader(file) { | |||
| 114 | 114 | ||
| 115 | AppLoader_NRO::~AppLoader_NRO() = default; | 115 | AppLoader_NRO::~AppLoader_NRO() = default; |
| 116 | 116 | ||
| 117 | FileType AppLoader_NRO::IdentifyType(const FileSys::VirtualFile& file) { | 117 | FileType AppLoader_NRO::IdentifyType(const FileSys::VirtualFile& nro_file) { |
| 118 | // Read NSO header | 118 | // Read NSO header |
| 119 | NroHeader nro_header{}; | 119 | NroHeader nro_header{}; |
| 120 | if (sizeof(NroHeader) != file->ReadObject(&nro_header)) { | 120 | if (sizeof(NroHeader) != nro_file->ReadObject(&nro_header)) { |
| 121 | return FileType::Error; | 121 | return FileType::Error; |
| 122 | } | 122 | } |
| 123 | if (nro_header.magic == Common::MakeMagic('N', 'R', 'O', '0')) { | 123 | if (nro_header.magic == Common::MakeMagic('N', 'R', 'O', '0')) { |
| @@ -130,8 +130,7 @@ static constexpr u32 PageAlignSize(u32 size) { | |||
| 130 | return static_cast<u32>((size + Core::Memory::PAGE_MASK) & ~Core::Memory::PAGE_MASK); | 130 | return static_cast<u32>((size + Core::Memory::PAGE_MASK) & ~Core::Memory::PAGE_MASK); |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | static bool LoadNroImpl(Kernel::Process& process, const std::vector<u8>& data, | 133 | static bool LoadNroImpl(Kernel::Process& process, const std::vector<u8>& data) { |
| 134 | const std::string& name) { | ||
| 135 | if (data.size() < sizeof(NroHeader)) { | 134 | if (data.size() < sizeof(NroHeader)) { |
| 136 | return {}; | 135 | return {}; |
| 137 | } | 136 | } |
| @@ -200,8 +199,8 @@ static bool LoadNroImpl(Kernel::Process& process, const std::vector<u8>& data, | |||
| 200 | return true; | 199 | return true; |
| 201 | } | 200 | } |
| 202 | 201 | ||
| 203 | bool AppLoader_NRO::LoadNro(Kernel::Process& process, const FileSys::VfsFile& file) { | 202 | bool AppLoader_NRO::LoadNro(Kernel::Process& process, const FileSys::VfsFile& nro_file) { |
| 204 | return LoadNroImpl(process, file.ReadAllBytes(), file.GetName()); | 203 | return LoadNroImpl(process, nro_file.ReadAllBytes()); |
| 205 | } | 204 | } |
| 206 | 205 | ||
| 207 | AppLoader_NRO::LoadResult AppLoader_NRO::Load(Kernel::Process& process, Core::System& system) { | 206 | AppLoader_NRO::LoadResult AppLoader_NRO::Load(Kernel::Process& process, Core::System& system) { |
diff --git a/src/core/loader/nro.h b/src/core/loader/nro.h index a82b66221..20bbaeb0e 100644 --- a/src/core/loader/nro.h +++ b/src/core/loader/nro.h | |||
| @@ -27,15 +27,17 @@ namespace Loader { | |||
| 27 | /// Loads an NRO file | 27 | /// Loads an NRO file |
| 28 | class AppLoader_NRO final : public AppLoader { | 28 | class AppLoader_NRO final : public AppLoader { |
| 29 | public: | 29 | public: |
| 30 | explicit AppLoader_NRO(FileSys::VirtualFile file); | 30 | explicit AppLoader_NRO(FileSys::VirtualFile file_); |
| 31 | ~AppLoader_NRO() override; | 31 | ~AppLoader_NRO() override; |
| 32 | 32 | ||
| 33 | /** | 33 | /** |
| 34 | * Returns the type of the file | 34 | * Identifies whether or not the given file is an NRO file. |
| 35 | * @param file open file | 35 | * |
| 36 | * @return FileType found, or FileType::Error if this loader doesn't know it | 36 | * @param nro_file The file to identify. |
| 37 | * | ||
| 38 | * @return FileType::NRO, or FileType::Error if the file is not an NRO file. | ||
| 37 | */ | 39 | */ |
| 38 | static FileType IdentifyType(const FileSys::VirtualFile& file); | 40 | static FileType IdentifyType(const FileSys::VirtualFile& nro_file); |
| 39 | 41 | ||
| 40 | FileType GetFileType() const override { | 42 | FileType GetFileType() const override { |
| 41 | return IdentifyType(file); | 43 | return IdentifyType(file); |
| @@ -51,7 +53,7 @@ public: | |||
| 51 | bool IsRomFSUpdatable() const override; | 53 | bool IsRomFSUpdatable() const override; |
| 52 | 54 | ||
| 53 | private: | 55 | private: |
| 54 | bool LoadNro(Kernel::Process& process, const FileSys::VfsFile& file); | 56 | bool LoadNro(Kernel::Process& process, const FileSys::VfsFile& nro_file); |
| 55 | 57 | ||
| 56 | std::vector<u8> icon_data; | 58 | std::vector<u8> icon_data; |
| 57 | std::unique_ptr<FileSys::NACP> nacp; | 59 | std::unique_ptr<FileSys::NACP> nacp; |
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 0c83dd666..f671afe02 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp | |||
| @@ -56,11 +56,11 @@ bool NSOHeader::IsSegmentCompressed(size_t segment_num) const { | |||
| 56 | return ((flags >> segment_num) & 1) != 0; | 56 | return ((flags >> segment_num) & 1) != 0; |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | AppLoader_NSO::AppLoader_NSO(FileSys::VirtualFile file) : AppLoader(std::move(file)) {} | 59 | AppLoader_NSO::AppLoader_NSO(FileSys::VirtualFile file_) : AppLoader(std::move(file_)) {} |
| 60 | 60 | ||
| 61 | FileType AppLoader_NSO::IdentifyType(const FileSys::VirtualFile& file) { | 61 | FileType AppLoader_NSO::IdentifyType(const FileSys::VirtualFile& in_file) { |
| 62 | u32 magic = 0; | 62 | u32 magic = 0; |
| 63 | if (file->ReadObject(&magic) != sizeof(magic)) { | 63 | if (in_file->ReadObject(&magic) != sizeof(magic)) { |
| 64 | return FileType::Error; | 64 | return FileType::Error; |
| 65 | } | 65 | } |
| 66 | 66 | ||
| @@ -72,15 +72,15 @@ FileType AppLoader_NSO::IdentifyType(const FileSys::VirtualFile& file) { | |||
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process, Core::System& system, | 74 | std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process, Core::System& system, |
| 75 | const FileSys::VfsFile& file, VAddr load_base, | 75 | const FileSys::VfsFile& nso_file, VAddr load_base, |
| 76 | bool should_pass_arguments, bool load_into_process, | 76 | bool should_pass_arguments, bool load_into_process, |
| 77 | std::optional<FileSys::PatchManager> pm) { | 77 | std::optional<FileSys::PatchManager> pm) { |
| 78 | if (file.GetSize() < sizeof(NSOHeader)) { | 78 | if (nso_file.GetSize() < sizeof(NSOHeader)) { |
| 79 | return std::nullopt; | 79 | return std::nullopt; |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | NSOHeader nso_header{}; | 82 | NSOHeader nso_header{}; |
| 83 | if (sizeof(NSOHeader) != file.ReadObject(&nso_header)) { | 83 | if (sizeof(NSOHeader) != nso_file.ReadObject(&nso_header)) { |
| 84 | return std::nullopt; | 84 | return std::nullopt; |
| 85 | } | 85 | } |
| 86 | 86 | ||
| @@ -92,8 +92,8 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process, Core::S | |||
| 92 | Kernel::CodeSet codeset; | 92 | Kernel::CodeSet codeset; |
| 93 | Kernel::PhysicalMemory program_image; | 93 | Kernel::PhysicalMemory program_image; |
| 94 | for (std::size_t i = 0; i < nso_header.segments.size(); ++i) { | 94 | for (std::size_t i = 0; i < nso_header.segments.size(); ++i) { |
| 95 | std::vector<u8> data = | 95 | std::vector<u8> data = nso_file.ReadBytes(nso_header.segments_compressed_size[i], |
| 96 | file.ReadBytes(nso_header.segments_compressed_size[i], nso_header.segments[i].offset); | 96 | nso_header.segments[i].offset); |
| 97 | if (nso_header.IsSegmentCompressed(i)) { | 97 | if (nso_header.IsSegmentCompressed(i)) { |
| 98 | data = DecompressSegment(data, nso_header.segments[i]); | 98 | data = DecompressSegment(data, nso_header.segments[i]); |
| 99 | } | 99 | } |
| @@ -136,7 +136,7 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process, Core::S | |||
| 136 | pi_header.insert(pi_header.begin() + sizeof(NSOHeader), program_image.data(), | 136 | pi_header.insert(pi_header.begin() + sizeof(NSOHeader), program_image.data(), |
| 137 | program_image.data() + program_image.size()); | 137 | program_image.data() + program_image.size()); |
| 138 | 138 | ||
| 139 | pi_header = pm->PatchNSO(pi_header, file.GetName()); | 139 | pi_header = pm->PatchNSO(pi_header, nso_file.GetName()); |
| 140 | 140 | ||
| 141 | std::copy(pi_header.begin() + sizeof(NSOHeader), pi_header.end(), program_image.data()); | 141 | std::copy(pi_header.begin() + sizeof(NSOHeader), pi_header.end(), program_image.data()); |
| 142 | } | 142 | } |
| @@ -183,8 +183,8 @@ AppLoader_NSO::LoadResult AppLoader_NSO::Load(Kernel::Process& process, Core::Sy | |||
| 183 | Core::Memory::DEFAULT_STACK_SIZE}}; | 183 | Core::Memory::DEFAULT_STACK_SIZE}}; |
| 184 | } | 184 | } |
| 185 | 185 | ||
| 186 | ResultStatus AppLoader_NSO::ReadNSOModules(Modules& modules) { | 186 | ResultStatus AppLoader_NSO::ReadNSOModules(Modules& out_modules) { |
| 187 | modules = this->modules; | 187 | out_modules = this->modules; |
| 188 | return ResultStatus::Success; | 188 | return ResultStatus::Success; |
| 189 | } | 189 | } |
| 190 | 190 | ||
diff --git a/src/core/loader/nso.h b/src/core/loader/nso.h index 3af461b5f..195149b55 100644 --- a/src/core/loader/nso.h +++ b/src/core/loader/nso.h | |||
| @@ -71,27 +71,29 @@ static_assert(sizeof(NSOArgumentHeader) == 0x20, "NSOArgumentHeader has incorrec | |||
| 71 | /// Loads an NSO file | 71 | /// Loads an NSO file |
| 72 | class AppLoader_NSO final : public AppLoader { | 72 | class AppLoader_NSO final : public AppLoader { |
| 73 | public: | 73 | public: |
| 74 | explicit AppLoader_NSO(FileSys::VirtualFile file); | 74 | explicit AppLoader_NSO(FileSys::VirtualFile file_); |
| 75 | 75 | ||
| 76 | /** | 76 | /** |
| 77 | * Returns the type of the file | 77 | * Identifies whether or not the given file is a form of NSO file. |
| 78 | * @param file open file | 78 | * |
| 79 | * @return FileType found, or FileType::Error if this loader doesn't know it | 79 | * @param in_file The file to be identified. |
| 80 | * | ||
| 81 | * @return FileType::NSO if found, or FileType::Error if some other type of file. | ||
| 80 | */ | 82 | */ |
| 81 | static FileType IdentifyType(const FileSys::VirtualFile& file); | 83 | static FileType IdentifyType(const FileSys::VirtualFile& in_file); |
| 82 | 84 | ||
| 83 | FileType GetFileType() const override { | 85 | FileType GetFileType() const override { |
| 84 | return IdentifyType(file); | 86 | return IdentifyType(file); |
| 85 | } | 87 | } |
| 86 | 88 | ||
| 87 | static std::optional<VAddr> LoadModule(Kernel::Process& process, Core::System& system, | 89 | static std::optional<VAddr> LoadModule(Kernel::Process& process, Core::System& system, |
| 88 | const FileSys::VfsFile& file, VAddr load_base, | 90 | const FileSys::VfsFile& nso_file, VAddr load_base, |
| 89 | bool should_pass_arguments, bool load_into_process, | 91 | bool should_pass_arguments, bool load_into_process, |
| 90 | std::optional<FileSys::PatchManager> pm = {}); | 92 | std::optional<FileSys::PatchManager> pm = {}); |
| 91 | 93 | ||
| 92 | LoadResult Load(Kernel::Process& process, Core::System& system) override; | 94 | LoadResult Load(Kernel::Process& process, Core::System& system) override; |
| 93 | 95 | ||
| 94 | ResultStatus ReadNSOModules(Modules& modules) override; | 96 | ResultStatus ReadNSOModules(Modules& out_modules) override; |
| 95 | 97 | ||
| 96 | private: | 98 | private: |
| 97 | Modules modules; | 99 | Modules modules; |
diff --git a/src/core/loader/nsp.cpp b/src/core/loader/nsp.cpp index 928f64c8c..d7e590f1c 100644 --- a/src/core/loader/nsp.cpp +++ b/src/core/loader/nsp.cpp | |||
| @@ -21,11 +21,11 @@ | |||
| 21 | 21 | ||
| 22 | namespace Loader { | 22 | namespace Loader { |
| 23 | 23 | ||
| 24 | AppLoader_NSP::AppLoader_NSP(FileSys::VirtualFile file, | 24 | AppLoader_NSP::AppLoader_NSP(FileSys::VirtualFile file_, |
| 25 | const Service::FileSystem::FileSystemController& fsc, | 25 | const Service::FileSystem::FileSystemController& fsc, |
| 26 | const FileSys::ContentProvider& content_provider, | 26 | const FileSys::ContentProvider& content_provider, |
| 27 | std::size_t program_index) | 27 | std::size_t program_index) |
| 28 | : AppLoader(file), nsp(std::make_unique<FileSys::NSP>(file, program_index)), | 28 | : AppLoader(file_), nsp(std::make_unique<FileSys::NSP>(file_, program_index)), |
| 29 | title_id(nsp->GetProgramTitleID()) { | 29 | title_id(nsp->GetProgramTitleID()) { |
| 30 | 30 | ||
| 31 | if (nsp->GetStatus() != ResultStatus::Success) { | 31 | if (nsp->GetStatus() != ResultStatus::Success) { |
| @@ -57,8 +57,8 @@ AppLoader_NSP::AppLoader_NSP(FileSys::VirtualFile file, | |||
| 57 | 57 | ||
| 58 | AppLoader_NSP::~AppLoader_NSP() = default; | 58 | AppLoader_NSP::~AppLoader_NSP() = default; |
| 59 | 59 | ||
| 60 | FileType AppLoader_NSP::IdentifyType(const FileSys::VirtualFile& file) { | 60 | FileType AppLoader_NSP::IdentifyType(const FileSys::VirtualFile& nsp_file) { |
| 61 | FileSys::NSP nsp(file); | 61 | const FileSys::NSP nsp(nsp_file); |
| 62 | 62 | ||
| 63 | if (nsp.GetStatus() == ResultStatus::Success) { | 63 | if (nsp.GetStatus() == ResultStatus::Success) { |
| 64 | // Extracted Type case | 64 | // Extracted Type case |
| @@ -121,67 +121,80 @@ AppLoader_NSP::LoadResult AppLoader_NSP::Load(Kernel::Process& process, Core::Sy | |||
| 121 | return result; | 121 | return result; |
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | ResultStatus AppLoader_NSP::ReadRomFS(FileSys::VirtualFile& file) { | 124 | ResultStatus AppLoader_NSP::ReadRomFS(FileSys::VirtualFile& out_file) { |
| 125 | return secondary_loader->ReadRomFS(file); | 125 | return secondary_loader->ReadRomFS(out_file); |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | u64 AppLoader_NSP::ReadRomFSIVFCOffset() const { | 128 | u64 AppLoader_NSP::ReadRomFSIVFCOffset() const { |
| 129 | return secondary_loader->ReadRomFSIVFCOffset(); | 129 | return secondary_loader->ReadRomFSIVFCOffset(); |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | ResultStatus AppLoader_NSP::ReadUpdateRaw(FileSys::VirtualFile& file) { | 132 | ResultStatus AppLoader_NSP::ReadUpdateRaw(FileSys::VirtualFile& out_file) { |
| 133 | if (nsp->IsExtractedType()) | 133 | if (nsp->IsExtractedType()) { |
| 134 | return ResultStatus::ErrorNoPackedUpdate; | 134 | return ResultStatus::ErrorNoPackedUpdate; |
| 135 | } | ||
| 135 | 136 | ||
| 136 | const auto read = | 137 | const auto read = |
| 137 | nsp->GetNCAFile(FileSys::GetUpdateTitleID(title_id), FileSys::ContentRecordType::Program); | 138 | nsp->GetNCAFile(FileSys::GetUpdateTitleID(title_id), FileSys::ContentRecordType::Program); |
| 138 | 139 | ||
| 139 | if (read == nullptr) | 140 | if (read == nullptr) { |
| 140 | return ResultStatus::ErrorNoPackedUpdate; | 141 | return ResultStatus::ErrorNoPackedUpdate; |
| 141 | const auto nca_test = std::make_shared<FileSys::NCA>(read); | 142 | } |
| 142 | 143 | ||
| 143 | if (nca_test->GetStatus() != ResultStatus::ErrorMissingBKTRBaseRomFS) | 144 | const auto nca_test = std::make_shared<FileSys::NCA>(read); |
| 145 | if (nca_test->GetStatus() != ResultStatus::ErrorMissingBKTRBaseRomFS) { | ||
| 144 | return nca_test->GetStatus(); | 146 | return nca_test->GetStatus(); |
| 147 | } | ||
| 145 | 148 | ||
| 146 | file = read; | 149 | out_file = read; |
| 147 | return ResultStatus::Success; | 150 | return ResultStatus::Success; |
| 148 | } | 151 | } |
| 149 | 152 | ||
| 150 | ResultStatus AppLoader_NSP::ReadProgramId(u64& out_program_id) { | 153 | ResultStatus AppLoader_NSP::ReadProgramId(u64& out_program_id) { |
| 151 | if (title_id == 0) | 154 | if (title_id == 0) { |
| 152 | return ResultStatus::ErrorNotInitialized; | 155 | return ResultStatus::ErrorNotInitialized; |
| 156 | } | ||
| 157 | |||
| 153 | out_program_id = title_id; | 158 | out_program_id = title_id; |
| 154 | return ResultStatus::Success; | 159 | return ResultStatus::Success; |
| 155 | } | 160 | } |
| 156 | 161 | ||
| 157 | ResultStatus AppLoader_NSP::ReadIcon(std::vector<u8>& buffer) { | 162 | ResultStatus AppLoader_NSP::ReadIcon(std::vector<u8>& buffer) { |
| 158 | if (icon_file == nullptr) | 163 | if (icon_file == nullptr) { |
| 159 | return ResultStatus::ErrorNoControl; | 164 | return ResultStatus::ErrorNoControl; |
| 165 | } | ||
| 166 | |||
| 160 | buffer = icon_file->ReadAllBytes(); | 167 | buffer = icon_file->ReadAllBytes(); |
| 161 | return ResultStatus::Success; | 168 | return ResultStatus::Success; |
| 162 | } | 169 | } |
| 163 | 170 | ||
| 164 | ResultStatus AppLoader_NSP::ReadTitle(std::string& title) { | 171 | ResultStatus AppLoader_NSP::ReadTitle(std::string& title) { |
| 165 | if (nacp_file == nullptr) | 172 | if (nacp_file == nullptr) { |
| 166 | return ResultStatus::ErrorNoControl; | 173 | return ResultStatus::ErrorNoControl; |
| 174 | } | ||
| 175 | |||
| 167 | title = nacp_file->GetApplicationName(); | 176 | title = nacp_file->GetApplicationName(); |
| 168 | return ResultStatus::Success; | 177 | return ResultStatus::Success; |
| 169 | } | 178 | } |
| 170 | 179 | ||
| 171 | ResultStatus AppLoader_NSP::ReadControlData(FileSys::NACP& nacp) { | 180 | ResultStatus AppLoader_NSP::ReadControlData(FileSys::NACP& nacp) { |
| 172 | if (nacp_file == nullptr) | 181 | if (nacp_file == nullptr) { |
| 173 | return ResultStatus::ErrorNoControl; | 182 | return ResultStatus::ErrorNoControl; |
| 183 | } | ||
| 184 | |||
| 174 | nacp = *nacp_file; | 185 | nacp = *nacp_file; |
| 175 | return ResultStatus::Success; | 186 | return ResultStatus::Success; |
| 176 | } | 187 | } |
| 177 | 188 | ||
| 178 | ResultStatus AppLoader_NSP::ReadManualRomFS(FileSys::VirtualFile& file) { | 189 | ResultStatus AppLoader_NSP::ReadManualRomFS(FileSys::VirtualFile& out_file) { |
| 179 | const auto nca = | 190 | const auto nca = |
| 180 | nsp->GetNCA(nsp->GetProgramTitleID(), FileSys::ContentRecordType::HtmlDocument); | 191 | nsp->GetNCA(nsp->GetProgramTitleID(), FileSys::ContentRecordType::HtmlDocument); |
| 181 | if (nsp->GetStatus() != ResultStatus::Success || nca == nullptr) | 192 | if (nsp->GetStatus() != ResultStatus::Success || nca == nullptr) { |
| 182 | return ResultStatus::ErrorNoRomFS; | 193 | return ResultStatus::ErrorNoRomFS; |
| 183 | file = nca->GetRomFS(); | 194 | } |
| 184 | return file == nullptr ? ResultStatus::ErrorNoRomFS : ResultStatus::Success; | 195 | |
| 196 | out_file = nca->GetRomFS(); | ||
| 197 | return out_file == nullptr ? ResultStatus::ErrorNoRomFS : ResultStatus::Success; | ||
| 185 | } | 198 | } |
| 186 | 199 | ||
| 187 | ResultStatus AppLoader_NSP::ReadBanner(std::vector<u8>& buffer) { | 200 | ResultStatus AppLoader_NSP::ReadBanner(std::vector<u8>& buffer) { |
diff --git a/src/core/loader/nsp.h b/src/core/loader/nsp.h index d48d87f2c..1660f1b94 100644 --- a/src/core/loader/nsp.h +++ b/src/core/loader/nsp.h | |||
| @@ -26,18 +26,20 @@ class AppLoader_NCA; | |||
| 26 | /// Loads an XCI file | 26 | /// Loads an XCI file |
| 27 | class AppLoader_NSP final : public AppLoader { | 27 | class AppLoader_NSP final : public AppLoader { |
| 28 | public: | 28 | public: |
| 29 | explicit AppLoader_NSP(FileSys::VirtualFile file, | 29 | explicit AppLoader_NSP(FileSys::VirtualFile file_, |
| 30 | const Service::FileSystem::FileSystemController& fsc, | 30 | const Service::FileSystem::FileSystemController& fsc, |
| 31 | const FileSys::ContentProvider& content_provider, | 31 | const FileSys::ContentProvider& content_provider, |
| 32 | std::size_t program_index); | 32 | std::size_t program_index); |
| 33 | ~AppLoader_NSP() override; | 33 | ~AppLoader_NSP() override; |
| 34 | 34 | ||
| 35 | /** | 35 | /** |
| 36 | * Returns the type of the file | 36 | * Identifies whether or not the given file is an NSP file. |
| 37 | * @param file open file | 37 | * |
| 38 | * @return FileType found, or FileType::Error if this loader doesn't know it | 38 | * @param nsp_file The file to identify. |
| 39 | * | ||
| 40 | * @return FileType::NSP, or FileType::Error if the file is not an NSP. | ||
| 39 | */ | 41 | */ |
| 40 | static FileType IdentifyType(const FileSys::VirtualFile& file); | 42 | static FileType IdentifyType(const FileSys::VirtualFile& nsp_file); |
| 41 | 43 | ||
| 42 | FileType GetFileType() const override { | 44 | FileType GetFileType() const override { |
| 43 | return IdentifyType(file); | 45 | return IdentifyType(file); |
| @@ -45,14 +47,14 @@ public: | |||
| 45 | 47 | ||
| 46 | LoadResult Load(Kernel::Process& process, Core::System& system) override; | 48 | LoadResult Load(Kernel::Process& process, Core::System& system) override; |
| 47 | 49 | ||
| 48 | ResultStatus ReadRomFS(FileSys::VirtualFile& file) override; | 50 | ResultStatus ReadRomFS(FileSys::VirtualFile& out_file) override; |
| 49 | u64 ReadRomFSIVFCOffset() const override; | 51 | u64 ReadRomFSIVFCOffset() const override; |
| 50 | ResultStatus ReadUpdateRaw(FileSys::VirtualFile& file) override; | 52 | ResultStatus ReadUpdateRaw(FileSys::VirtualFile& out_file) override; |
| 51 | ResultStatus ReadProgramId(u64& out_program_id) override; | 53 | ResultStatus ReadProgramId(u64& out_program_id) override; |
| 52 | ResultStatus ReadIcon(std::vector<u8>& buffer) override; | 54 | ResultStatus ReadIcon(std::vector<u8>& buffer) override; |
| 53 | ResultStatus ReadTitle(std::string& title) override; | 55 | ResultStatus ReadTitle(std::string& title) override; |
| 54 | ResultStatus ReadControlData(FileSys::NACP& nacp) override; | 56 | ResultStatus ReadControlData(FileSys::NACP& nacp) override; |
| 55 | ResultStatus ReadManualRomFS(FileSys::VirtualFile& file) override; | 57 | ResultStatus ReadManualRomFS(FileSys::VirtualFile& out_file) override; |
| 56 | 58 | ||
| 57 | ResultStatus ReadBanner(std::vector<u8>& buffer) override; | 59 | ResultStatus ReadBanner(std::vector<u8>& buffer) override; |
| 58 | ResultStatus ReadLogo(std::vector<u8>& buffer) override; | 60 | ResultStatus ReadLogo(std::vector<u8>& buffer) override; |
diff --git a/src/core/loader/xci.cpp b/src/core/loader/xci.cpp index aaa250cea..0125ddf33 100644 --- a/src/core/loader/xci.cpp +++ b/src/core/loader/xci.cpp | |||
| @@ -20,11 +20,11 @@ | |||
| 20 | 20 | ||
| 21 | namespace Loader { | 21 | namespace Loader { |
| 22 | 22 | ||
| 23 | AppLoader_XCI::AppLoader_XCI(FileSys::VirtualFile file, | 23 | AppLoader_XCI::AppLoader_XCI(FileSys::VirtualFile file_, |
| 24 | const Service::FileSystem::FileSystemController& fsc, | 24 | const Service::FileSystem::FileSystemController& fsc, |
| 25 | const FileSys::ContentProvider& content_provider, | 25 | const FileSys::ContentProvider& content_provider, |
| 26 | std::size_t program_index) | 26 | std::size_t program_index) |
| 27 | : AppLoader(file), xci(std::make_unique<FileSys::XCI>(file, program_index)), | 27 | : AppLoader(file_), xci(std::make_unique<FileSys::XCI>(file_, program_index)), |
| 28 | nca_loader(std::make_unique<AppLoader_NCA>(xci->GetProgramNCAFile())) { | 28 | nca_loader(std::make_unique<AppLoader_NCA>(xci->GetProgramNCAFile())) { |
| 29 | if (xci->GetStatus() != ResultStatus::Success) { | 29 | if (xci->GetStatus() != ResultStatus::Success) { |
| 30 | return; | 30 | return; |
| @@ -43,8 +43,8 @@ AppLoader_XCI::AppLoader_XCI(FileSys::VirtualFile file, | |||
| 43 | 43 | ||
| 44 | AppLoader_XCI::~AppLoader_XCI() = default; | 44 | AppLoader_XCI::~AppLoader_XCI() = default; |
| 45 | 45 | ||
| 46 | FileType AppLoader_XCI::IdentifyType(const FileSys::VirtualFile& file) { | 46 | FileType AppLoader_XCI::IdentifyType(const FileSys::VirtualFile& xci_file) { |
| 47 | FileSys::XCI xci(file); | 47 | const FileSys::XCI xci(xci_file); |
| 48 | 48 | ||
| 49 | if (xci.GetStatus() == ResultStatus::Success && | 49 | if (xci.GetStatus() == ResultStatus::Success && |
| 50 | xci.GetNCAByType(FileSys::NCAContentType::Program) != nullptr && | 50 | xci.GetNCAByType(FileSys::NCAContentType::Program) != nullptr && |
| @@ -87,31 +87,33 @@ AppLoader_XCI::LoadResult AppLoader_XCI::Load(Kernel::Process& process, Core::Sy | |||
| 87 | return result; | 87 | return result; |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | ResultStatus AppLoader_XCI::ReadRomFS(FileSys::VirtualFile& file) { | 90 | ResultStatus AppLoader_XCI::ReadRomFS(FileSys::VirtualFile& out_file) { |
| 91 | return nca_loader->ReadRomFS(file); | 91 | return nca_loader->ReadRomFS(out_file); |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | u64 AppLoader_XCI::ReadRomFSIVFCOffset() const { | 94 | u64 AppLoader_XCI::ReadRomFSIVFCOffset() const { |
| 95 | return nca_loader->ReadRomFSIVFCOffset(); | 95 | return nca_loader->ReadRomFSIVFCOffset(); |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | ResultStatus AppLoader_XCI::ReadUpdateRaw(FileSys::VirtualFile& file) { | 98 | ResultStatus AppLoader_XCI::ReadUpdateRaw(FileSys::VirtualFile& out_file) { |
| 99 | u64 program_id{}; | 99 | u64 program_id{}; |
| 100 | nca_loader->ReadProgramId(program_id); | 100 | nca_loader->ReadProgramId(program_id); |
| 101 | if (program_id == 0) | 101 | if (program_id == 0) { |
| 102 | return ResultStatus::ErrorXCIMissingProgramNCA; | 102 | return ResultStatus::ErrorXCIMissingProgramNCA; |
| 103 | } | ||
| 103 | 104 | ||
| 104 | const auto read = xci->GetSecurePartitionNSP()->GetNCAFile( | 105 | const auto read = xci->GetSecurePartitionNSP()->GetNCAFile( |
| 105 | FileSys::GetUpdateTitleID(program_id), FileSys::ContentRecordType::Program); | 106 | FileSys::GetUpdateTitleID(program_id), FileSys::ContentRecordType::Program); |
| 106 | 107 | if (read == nullptr) { | |
| 107 | if (read == nullptr) | ||
| 108 | return ResultStatus::ErrorNoPackedUpdate; | 108 | return ResultStatus::ErrorNoPackedUpdate; |
| 109 | const auto nca_test = std::make_shared<FileSys::NCA>(read); | 109 | } |
| 110 | 110 | ||
| 111 | if (nca_test->GetStatus() != ResultStatus::ErrorMissingBKTRBaseRomFS) | 111 | const auto nca_test = std::make_shared<FileSys::NCA>(read); |
| 112 | if (nca_test->GetStatus() != ResultStatus::ErrorMissingBKTRBaseRomFS) { | ||
| 112 | return nca_test->GetStatus(); | 113 | return nca_test->GetStatus(); |
| 114 | } | ||
| 113 | 115 | ||
| 114 | file = read; | 116 | out_file = read; |
| 115 | return ResultStatus::Success; | 117 | return ResultStatus::Success; |
| 116 | } | 118 | } |
| 117 | 119 | ||
| @@ -120,33 +122,41 @@ ResultStatus AppLoader_XCI::ReadProgramId(u64& out_program_id) { | |||
| 120 | } | 122 | } |
| 121 | 123 | ||
| 122 | ResultStatus AppLoader_XCI::ReadIcon(std::vector<u8>& buffer) { | 124 | ResultStatus AppLoader_XCI::ReadIcon(std::vector<u8>& buffer) { |
| 123 | if (icon_file == nullptr) | 125 | if (icon_file == nullptr) { |
| 124 | return ResultStatus::ErrorNoControl; | 126 | return ResultStatus::ErrorNoControl; |
| 127 | } | ||
| 128 | |||
| 125 | buffer = icon_file->ReadAllBytes(); | 129 | buffer = icon_file->ReadAllBytes(); |
| 126 | return ResultStatus::Success; | 130 | return ResultStatus::Success; |
| 127 | } | 131 | } |
| 128 | 132 | ||
| 129 | ResultStatus AppLoader_XCI::ReadTitle(std::string& title) { | 133 | ResultStatus AppLoader_XCI::ReadTitle(std::string& title) { |
| 130 | if (nacp_file == nullptr) | 134 | if (nacp_file == nullptr) { |
| 131 | return ResultStatus::ErrorNoControl; | 135 | return ResultStatus::ErrorNoControl; |
| 136 | } | ||
| 137 | |||
| 132 | title = nacp_file->GetApplicationName(); | 138 | title = nacp_file->GetApplicationName(); |
| 133 | return ResultStatus::Success; | 139 | return ResultStatus::Success; |
| 134 | } | 140 | } |
| 135 | 141 | ||
| 136 | ResultStatus AppLoader_XCI::ReadControlData(FileSys::NACP& control) { | 142 | ResultStatus AppLoader_XCI::ReadControlData(FileSys::NACP& control) { |
| 137 | if (nacp_file == nullptr) | 143 | if (nacp_file == nullptr) { |
| 138 | return ResultStatus::ErrorNoControl; | 144 | return ResultStatus::ErrorNoControl; |
| 145 | } | ||
| 146 | |||
| 139 | control = *nacp_file; | 147 | control = *nacp_file; |
| 140 | return ResultStatus::Success; | 148 | return ResultStatus::Success; |
| 141 | } | 149 | } |
| 142 | 150 | ||
| 143 | ResultStatus AppLoader_XCI::ReadManualRomFS(FileSys::VirtualFile& file) { | 151 | ResultStatus AppLoader_XCI::ReadManualRomFS(FileSys::VirtualFile& out_file) { |
| 144 | const auto nca = xci->GetSecurePartitionNSP()->GetNCA(xci->GetProgramTitleID(), | 152 | const auto nca = xci->GetSecurePartitionNSP()->GetNCA(xci->GetProgramTitleID(), |
| 145 | FileSys::ContentRecordType::HtmlDocument); | 153 | FileSys::ContentRecordType::HtmlDocument); |
| 146 | if (xci->GetStatus() != ResultStatus::Success || nca == nullptr) | 154 | if (xci->GetStatus() != ResultStatus::Success || nca == nullptr) { |
| 147 | return ResultStatus::ErrorXCIMissingPartition; | 155 | return ResultStatus::ErrorXCIMissingPartition; |
| 148 | file = nca->GetRomFS(); | 156 | } |
| 149 | return file == nullptr ? ResultStatus::ErrorNoRomFS : ResultStatus::Success; | 157 | |
| 158 | out_file = nca->GetRomFS(); | ||
| 159 | return out_file == nullptr ? ResultStatus::ErrorNoRomFS : ResultStatus::Success; | ||
| 150 | } | 160 | } |
| 151 | 161 | ||
| 152 | ResultStatus AppLoader_XCI::ReadBanner(std::vector<u8>& buffer) { | 162 | ResultStatus AppLoader_XCI::ReadBanner(std::vector<u8>& buffer) { |
diff --git a/src/core/loader/xci.h b/src/core/loader/xci.h index 9f0ceb5ef..7ea8179af 100644 --- a/src/core/loader/xci.h +++ b/src/core/loader/xci.h | |||
| @@ -26,18 +26,20 @@ class AppLoader_NCA; | |||
| 26 | /// Loads an XCI file | 26 | /// Loads an XCI file |
| 27 | class AppLoader_XCI final : public AppLoader { | 27 | class AppLoader_XCI final : public AppLoader { |
| 28 | public: | 28 | public: |
| 29 | explicit AppLoader_XCI(FileSys::VirtualFile file, | 29 | explicit AppLoader_XCI(FileSys::VirtualFile file_, |
| 30 | const Service::FileSystem::FileSystemController& fsc, | 30 | const Service::FileSystem::FileSystemController& fsc, |
| 31 | const FileSys::ContentProvider& content_provider, | 31 | const FileSys::ContentProvider& content_provider, |
| 32 | std::size_t program_index); | 32 | std::size_t program_index); |
| 33 | ~AppLoader_XCI() override; | 33 | ~AppLoader_XCI() override; |
| 34 | 34 | ||
| 35 | /** | 35 | /** |
| 36 | * Returns the type of the file | 36 | * Identifies whether or not the given file is an XCI file. |
| 37 | * @param file open file | 37 | * |
| 38 | * @return FileType found, or FileType::Error if this loader doesn't know it | 38 | * @param xci_file The file to identify. |
| 39 | * | ||
| 40 | * @return FileType::XCI, or FileType::Error if the file is not an XCI file. | ||
| 39 | */ | 41 | */ |
| 40 | static FileType IdentifyType(const FileSys::VirtualFile& file); | 42 | static FileType IdentifyType(const FileSys::VirtualFile& xci_file); |
| 41 | 43 | ||
| 42 | FileType GetFileType() const override { | 44 | FileType GetFileType() const override { |
| 43 | return IdentifyType(file); | 45 | return IdentifyType(file); |
| @@ -45,14 +47,14 @@ public: | |||
| 45 | 47 | ||
| 46 | LoadResult Load(Kernel::Process& process, Core::System& system) override; | 48 | LoadResult Load(Kernel::Process& process, Core::System& system) override; |
| 47 | 49 | ||
| 48 | ResultStatus ReadRomFS(FileSys::VirtualFile& file) override; | 50 | ResultStatus ReadRomFS(FileSys::VirtualFile& out_file) override; |
| 49 | u64 ReadRomFSIVFCOffset() const override; | 51 | u64 ReadRomFSIVFCOffset() const override; |
| 50 | ResultStatus ReadUpdateRaw(FileSys::VirtualFile& file) override; | 52 | ResultStatus ReadUpdateRaw(FileSys::VirtualFile& out_file) override; |
| 51 | ResultStatus ReadProgramId(u64& out_program_id) override; | 53 | ResultStatus ReadProgramId(u64& out_program_id) override; |
| 52 | ResultStatus ReadIcon(std::vector<u8>& buffer) override; | 54 | ResultStatus ReadIcon(std::vector<u8>& buffer) override; |
| 53 | ResultStatus ReadTitle(std::string& title) override; | 55 | ResultStatus ReadTitle(std::string& title) override; |
| 54 | ResultStatus ReadControlData(FileSys::NACP& control) override; | 56 | ResultStatus ReadControlData(FileSys::NACP& control) override; |
| 55 | ResultStatus ReadManualRomFS(FileSys::VirtualFile& file) override; | 57 | ResultStatus ReadManualRomFS(FileSys::VirtualFile& out_file) override; |
| 56 | 58 | ||
| 57 | ResultStatus ReadBanner(std::vector<u8>& buffer) override; | 59 | ResultStatus ReadBanner(std::vector<u8>& buffer) override; |
| 58 | ResultStatus ReadLogo(std::vector<u8>& buffer) override; | 60 | ResultStatus ReadLogo(std::vector<u8>& buffer) override; |
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 7c42f1177..a38024242 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp | |||
| @@ -492,10 +492,8 @@ void GPU::PushCommandBuffer(Tegra::ChCommandHeaderList& entries) { | |||
| 492 | cdma_pusher->ProcessEntries(std::move(entries)); | 492 | cdma_pusher->ProcessEntries(std::move(entries)); |
| 493 | } | 493 | } |
| 494 | 494 | ||
| 495 | void GPU::ClearCommandBuffer() { | 495 | void GPU::ClearCdmaInstance() { |
| 496 | // This condition fires when a video stream ends, clear all intermediary data | ||
| 497 | cdma_pusher.reset(); | 496 | cdma_pusher.reset(); |
| 498 | LOG_INFO(Service_NVDRV, "NVDEC video stream ended"); | ||
| 499 | } | 497 | } |
| 500 | 498 | ||
| 501 | void GPU::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) { | 499 | void GPU::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) { |
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index b1960ea86..8669e9940 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h | |||
| @@ -324,8 +324,8 @@ public: | |||
| 324 | /// Push GPU command buffer entries to be processed | 324 | /// Push GPU command buffer entries to be processed |
| 325 | void PushCommandBuffer(Tegra::ChCommandHeaderList& entries); | 325 | void PushCommandBuffer(Tegra::ChCommandHeaderList& entries); |
| 326 | 326 | ||
| 327 | /// Frees the CDMAPusher to free up resources | 327 | /// Frees the CDMAPusher instance to free up resources |
| 328 | void ClearCommandBuffer(); | 328 | void ClearCdmaInstance(); |
| 329 | 329 | ||
| 330 | /// Swap buffers (render frame) | 330 | /// Swap buffers (render frame) |
| 331 | void SwapBuffers(const Tegra::FramebufferConfig* framebuffer); | 331 | void SwapBuffers(const Tegra::FramebufferConfig* framebuffer); |
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index bc2a53841..017348e05 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp | |||
| @@ -417,7 +417,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) { | |||
| 417 | }; | 417 | }; |
| 418 | } | 418 | } |
| 419 | 419 | ||
| 420 | [[nodiscard]] constexpr SwizzleSource ConvertGreenRed(SwizzleSource value) { | 420 | [[nodiscard]] SwizzleSource ConvertGreenRed(SwizzleSource value) { |
| 421 | switch (value) { | 421 | switch (value) { |
| 422 | case SwizzleSource::G: | 422 | case SwizzleSource::G: |
| 423 | return SwizzleSource::R; | 423 | return SwizzleSource::R; |
| @@ -426,6 +426,17 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) { | |||
| 426 | } | 426 | } |
| 427 | } | 427 | } |
| 428 | 428 | ||
| 429 | [[nodiscard]] SwizzleSource SwapBlueRed(SwizzleSource value) { | ||
| 430 | switch (value) { | ||
| 431 | case SwizzleSource::R: | ||
| 432 | return SwizzleSource::B; | ||
| 433 | case SwizzleSource::B: | ||
| 434 | return SwizzleSource::R; | ||
| 435 | default: | ||
| 436 | return value; | ||
| 437 | } | ||
| 438 | } | ||
| 439 | |||
| 429 | void CopyBufferToImage(vk::CommandBuffer cmdbuf, VkBuffer src_buffer, VkImage image, | 440 | void CopyBufferToImage(vk::CommandBuffer cmdbuf, VkBuffer src_buffer, VkImage image, |
| 430 | VkImageAspectFlags aspect_mask, bool is_initialized, | 441 | VkImageAspectFlags aspect_mask, bool is_initialized, |
| 431 | std::span<const VkBufferImageCopy> copies) { | 442 | std::span<const VkBufferImageCopy> copies) { |
| @@ -543,6 +554,15 @@ void CopyBufferToImage(vk::CommandBuffer cmdbuf, VkBuffer src_buffer, VkImage im | |||
| 543 | }; | 554 | }; |
| 544 | } | 555 | } |
| 545 | 556 | ||
| 557 | [[nodiscard]] bool IsFormatFlipped(PixelFormat format) { | ||
| 558 | switch (format) { | ||
| 559 | case PixelFormat::A1B5G5R5_UNORM: | ||
| 560 | return true; | ||
| 561 | default: | ||
| 562 | return false; | ||
| 563 | } | ||
| 564 | } | ||
| 565 | |||
| 546 | struct RangedBarrierRange { | 566 | struct RangedBarrierRange { |
| 547 | u32 min_mip = std::numeric_limits<u32>::max(); | 567 | u32 min_mip = std::numeric_limits<u32>::max(); |
| 548 | u32 max_mip = std::numeric_limits<u32>::min(); | 568 | u32 max_mip = std::numeric_limits<u32>::min(); |
| @@ -948,6 +968,9 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI | |||
| 948 | }; | 968 | }; |
| 949 | if (!info.IsRenderTarget()) { | 969 | if (!info.IsRenderTarget()) { |
| 950 | swizzle = info.Swizzle(); | 970 | swizzle = info.Swizzle(); |
| 971 | if (IsFormatFlipped(format)) { | ||
| 972 | std::ranges::transform(swizzle, swizzle.begin(), SwapBlueRed); | ||
| 973 | } | ||
| 951 | if ((aspect_mask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) != 0) { | 974 | if ((aspect_mask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) != 0) { |
| 952 | std::ranges::transform(swizzle, swizzle.begin(), ConvertGreenRed); | 975 | std::ranges::transform(swizzle, swizzle.begin(), ConvertGreenRed); |
| 953 | } | 976 | } |
diff --git a/src/yuzu/applets/software_keyboard.cpp b/src/yuzu/applets/software_keyboard.cpp index fd3368479..653486493 100644 --- a/src/yuzu/applets/software_keyboard.cpp +++ b/src/yuzu/applets/software_keyboard.cpp | |||
| @@ -1027,10 +1027,8 @@ void QtSoftwareKeyboardDialog::ChangeBottomOSKIndex() { | |||
| 1027 | ui->bottomOSK->setCurrentIndex(static_cast<int>(bottom_osk_index)); | 1027 | ui->bottomOSK->setCurrentIndex(static_cast<int>(bottom_osk_index)); |
| 1028 | 1028 | ||
| 1029 | ui->button_shift_shift->setStyleSheet( | 1029 | ui->button_shift_shift->setStyleSheet( |
| 1030 | QStringLiteral("background-image: url(:/overlay/osk_button_shift_lock_off.png);" | 1030 | QStringLiteral("image: url(:/overlay/osk_button_shift_lock_off.png);" |
| 1031 | "\nbackground-position: left top;" | 1031 | "\nimage-position: left;")); |
| 1032 | "\nbackground-repeat: no-repeat;" | ||
| 1033 | "\nbackground-origin: content;")); | ||
| 1034 | 1032 | ||
| 1035 | ui->button_shift_shift->setIconSize(ui->button_shift->iconSize()); | 1033 | ui->button_shift_shift->setIconSize(ui->button_shift->iconSize()); |
| 1036 | ui->button_backspace_shift->setIconSize(ui->button_backspace->iconSize()); | 1034 | ui->button_backspace_shift->setIconSize(ui->button_backspace->iconSize()); |
| @@ -1040,10 +1038,8 @@ void QtSoftwareKeyboardDialog::ChangeBottomOSKIndex() { | |||
| 1040 | caps_lock_enabled = false; | 1038 | caps_lock_enabled = false; |
| 1041 | 1039 | ||
| 1042 | ui->button_shift_shift->setStyleSheet( | 1040 | ui->button_shift_shift->setStyleSheet( |
| 1043 | QStringLiteral("background-image: url(:/overlay/osk_button_shift_lock_off.png);" | 1041 | QStringLiteral("image: url(:/overlay/osk_button_shift_lock_off.png);" |
| 1044 | "\nbackground-position: left top;" | 1042 | "\nimage-position: left;")); |
| 1045 | "\nbackground-repeat: no-repeat;" | ||
| 1046 | "\nbackground-origin: content;")); | ||
| 1047 | 1043 | ||
| 1048 | ui->button_shift_shift->setIconSize(ui->button_shift->iconSize()); | 1044 | ui->button_shift_shift->setIconSize(ui->button_shift->iconSize()); |
| 1049 | ui->button_backspace_shift->setIconSize(ui->button_backspace->iconSize()); | 1045 | ui->button_backspace_shift->setIconSize(ui->button_backspace->iconSize()); |
| @@ -1056,10 +1052,8 @@ void QtSoftwareKeyboardDialog::ChangeBottomOSKIndex() { | |||
| 1056 | caps_lock_enabled = true; | 1052 | caps_lock_enabled = true; |
| 1057 | 1053 | ||
| 1058 | ui->button_shift_shift->setStyleSheet( | 1054 | ui->button_shift_shift->setStyleSheet( |
| 1059 | QStringLiteral("background-image: url(:/overlay/osk_button_shift_lock_on.png);" | 1055 | QStringLiteral("image: url(:/overlay/osk_button_shift_lock_on.png);" |
| 1060 | "\nbackground-position: left top;" | 1056 | "\nimage-position: left;")); |
| 1061 | "\nbackground-repeat: no-repeat;" | ||
| 1062 | "\nbackground-origin: content;")); | ||
| 1063 | 1057 | ||
| 1064 | ui->button_shift_shift->setIconSize(ui->button_shift->iconSize()); | 1058 | ui->button_shift_shift->setIconSize(ui->button_shift->iconSize()); |
| 1065 | ui->button_backspace_shift->setIconSize(ui->button_backspace->iconSize()); | 1059 | ui->button_backspace_shift->setIconSize(ui->button_backspace->iconSize()); |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 851246233..e80a3df77 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -29,9 +29,10 @@ Config::~Config() { | |||
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | const std::array<int, Settings::NativeButton::NumButtons> Config::default_buttons = { | 31 | const std::array<int, Settings::NativeButton::NumButtons> Config::default_buttons = { |
| 32 | Qt::Key_A, Qt::Key_S, Qt::Key_Z, Qt::Key_X, Qt::Key_3, Qt::Key_4, Qt::Key_Q, | 32 | Qt::Key_C, Qt::Key_X, Qt::Key_V, Qt::Key_Z, Qt::Key_F, |
| 33 | Qt::Key_W, Qt::Key_1, Qt::Key_2, Qt::Key_N, Qt::Key_M, Qt::Key_F, Qt::Key_T, | 33 | Qt::Key_G, Qt::Key_Q, Qt::Key_E, Qt::Key_R, Qt::Key_T, |
| 34 | Qt::Key_H, Qt::Key_G, Qt::Key_D, Qt::Key_C, Qt::Key_B, Qt::Key_V, | 34 | Qt::Key_M, Qt::Key_N, Qt::Key_Left, Qt::Key_Up, Qt::Key_Right, |
| 35 | Qt::Key_Down, Qt::Key_Q, Qt::Key_E, 0, 0, | ||
| 35 | }; | 36 | }; |
| 36 | 37 | ||
| 37 | const std::array<int, Settings::NativeMotion::NumMotions> Config::default_motions = { | 38 | const std::array<int, Settings::NativeMotion::NumMotions> Config::default_motions = { |
| @@ -41,10 +42,10 @@ const std::array<int, Settings::NativeMotion::NumMotions> Config::default_motion | |||
| 41 | 42 | ||
| 42 | const std::array<std::array<int, 4>, Settings::NativeAnalog::NumAnalogs> Config::default_analogs{{ | 43 | const std::array<std::array<int, 4>, Settings::NativeAnalog::NumAnalogs> Config::default_analogs{{ |
| 43 | { | 44 | { |
| 44 | Qt::Key_Up, | 45 | Qt::Key_W, |
| 45 | Qt::Key_Down, | 46 | Qt::Key_S, |
| 46 | Qt::Key_Left, | 47 | Qt::Key_A, |
| 47 | Qt::Key_Right, | 48 | Qt::Key_D, |
| 48 | }, | 49 | }, |
| 49 | { | 50 | { |
| 50 | Qt::Key_I, | 51 | Qt::Key_I, |
| @@ -55,8 +56,8 @@ const std::array<std::array<int, 4>, Settings::NativeAnalog::NumAnalogs> Config: | |||
| 55 | }}; | 56 | }}; |
| 56 | 57 | ||
| 57 | const std::array<int, 2> Config::default_stick_mod = { | 58 | const std::array<int, 2> Config::default_stick_mod = { |
| 58 | Qt::Key_E, | 59 | Qt::Key_Shift, |
| 59 | Qt::Key_R, | 60 | 0, |
| 60 | }; | 61 | }; |
| 61 | 62 | ||
| 62 | const std::array<int, Settings::NativeMouseButton::NumMouseButtons> Config::default_mouse_buttons = | 63 | const std::array<int, Settings::NativeMouseButton::NumMouseButtons> Config::default_mouse_buttons = |
| @@ -862,8 +863,7 @@ void Config::ReadSystemValues() { | |||
| 862 | Settings::values.rng_seed.SetGlobal(rng_seed_global); | 863 | Settings::values.rng_seed.SetGlobal(rng_seed_global); |
| 863 | if (global || !rng_seed_global) { | 864 | if (global || !rng_seed_global) { |
| 864 | if (rng_seed_enabled) { | 865 | if (rng_seed_enabled) { |
| 865 | Settings::values.rng_seed.SetValue( | 866 | Settings::values.rng_seed.SetValue(ReadSetting(QStringLiteral("rng_seed"), 0).toUInt()); |
| 866 | ReadSetting(QStringLiteral("rng_seed"), 0).toULongLong()); | ||
| 867 | } else { | 867 | } else { |
| 868 | Settings::values.rng_seed.SetValue(std::nullopt); | 868 | Settings::values.rng_seed.SetValue(std::nullopt); |
| 869 | } | 869 | } |
| @@ -936,6 +936,13 @@ void Config::ReadUIGamelistValues() { | |||
| 936 | UISettings::values.row_2_text_id = ReadSetting(QStringLiteral("row_2_text_id"), 2).toUInt(); | 936 | UISettings::values.row_2_text_id = ReadSetting(QStringLiteral("row_2_text_id"), 2).toUInt(); |
| 937 | UISettings::values.cache_game_list = | 937 | UISettings::values.cache_game_list = |
| 938 | ReadSetting(QStringLiteral("cache_game_list"), true).toBool(); | 938 | ReadSetting(QStringLiteral("cache_game_list"), true).toBool(); |
| 939 | const int favorites_size = qt_config->beginReadArray(QStringLiteral("favorites")); | ||
| 940 | for (int i = 0; i < favorites_size; i++) { | ||
| 941 | qt_config->setArrayIndex(i); | ||
| 942 | UISettings::values.favorited_ids.append( | ||
| 943 | ReadSetting(QStringLiteral("program_id")).toULongLong()); | ||
| 944 | } | ||
| 945 | qt_config->endArray(); | ||
| 939 | 946 | ||
| 940 | qt_config->endGroup(); | 947 | qt_config->endGroup(); |
| 941 | } | 948 | } |
| @@ -1479,6 +1486,13 @@ void Config::SaveUIGamelistValues() { | |||
| 1479 | WriteSetting(QStringLiteral("row_1_text_id"), UISettings::values.row_1_text_id, 3); | 1486 | WriteSetting(QStringLiteral("row_1_text_id"), UISettings::values.row_1_text_id, 3); |
| 1480 | WriteSetting(QStringLiteral("row_2_text_id"), UISettings::values.row_2_text_id, 2); | 1487 | WriteSetting(QStringLiteral("row_2_text_id"), UISettings::values.row_2_text_id, 2); |
| 1481 | WriteSetting(QStringLiteral("cache_game_list"), UISettings::values.cache_game_list, true); | 1488 | WriteSetting(QStringLiteral("cache_game_list"), UISettings::values.cache_game_list, true); |
| 1489 | qt_config->beginWriteArray(QStringLiteral("favorites")); | ||
| 1490 | for (int i = 0; i < UISettings::values.favorited_ids.size(); i++) { | ||
| 1491 | qt_config->setArrayIndex(i); | ||
| 1492 | WriteSetting(QStringLiteral("program_id"), | ||
| 1493 | QVariant::fromValue(UISettings::values.favorited_ids[i])); | ||
| 1494 | } | ||
| 1495 | qt_config->endArray(); | ||
| 1482 | 1496 | ||
| 1483 | qt_config->endGroup(); | 1497 | qt_config->endGroup(); |
| 1484 | } | 1498 | } |
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index 9afd5b45f..48b78d65f 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <QJsonDocument> | 11 | #include <QJsonDocument> |
| 12 | #include <QJsonObject> | 12 | #include <QJsonObject> |
| 13 | #include <QKeyEvent> | 13 | #include <QKeyEvent> |
| 14 | #include <QList> | ||
| 14 | #include <QMenu> | 15 | #include <QMenu> |
| 15 | #include <QThreadPool> | 16 | #include <QThreadPool> |
| 16 | #include <fmt/format.h> | 17 | #include <fmt/format.h> |
| @@ -84,6 +85,10 @@ void GameListSearchField::setFilterResult(int visible, int total) { | |||
| 84 | label_filter_result->setText(tr("%1 of %n result(s)", "", total).arg(visible)); | 85 | label_filter_result->setText(tr("%1 of %n result(s)", "", total).arg(visible)); |
| 85 | } | 86 | } |
| 86 | 87 | ||
| 88 | bool GameListSearchField::isEmpty() const { | ||
| 89 | return edit_filter->text().isEmpty(); | ||
| 90 | } | ||
| 91 | |||
| 87 | QString GameList::GetLastFilterResultItem() const { | 92 | QString GameList::GetLastFilterResultItem() const { |
| 88 | QString file_path; | 93 | QString file_path; |
| 89 | const int folder_count = item_model->rowCount(); | 94 | const int folder_count = item_model->rowCount(); |
| @@ -187,7 +192,9 @@ void GameList::OnTextChanged(const QString& new_text) { | |||
| 187 | // If the searchfield is empty every item is visible | 192 | // If the searchfield is empty every item is visible |
| 188 | // Otherwise the filter gets applied | 193 | // Otherwise the filter gets applied |
| 189 | if (edit_filter_text.isEmpty()) { | 194 | if (edit_filter_text.isEmpty()) { |
| 190 | for (int i = 0; i < folder_count; ++i) { | 195 | tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(), |
| 196 | UISettings::values.favorited_ids.size() == 0); | ||
| 197 | for (int i = 1; i < folder_count; ++i) { | ||
| 191 | folder = item_model->item(i, 0); | 198 | folder = item_model->item(i, 0); |
| 192 | const QModelIndex folder_index = folder->index(); | 199 | const QModelIndex folder_index = folder->index(); |
| 193 | const int children_count = folder->rowCount(); | 200 | const int children_count = folder->rowCount(); |
| @@ -198,8 +205,9 @@ void GameList::OnTextChanged(const QString& new_text) { | |||
| 198 | } | 205 | } |
| 199 | search_field->setFilterResult(children_total, children_total); | 206 | search_field->setFilterResult(children_total, children_total); |
| 200 | } else { | 207 | } else { |
| 208 | tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(), true); | ||
| 201 | int result_count = 0; | 209 | int result_count = 0; |
| 202 | for (int i = 0; i < folder_count; ++i) { | 210 | for (int i = 1; i < folder_count; ++i) { |
| 203 | folder = item_model->item(i, 0); | 211 | folder = item_model->item(i, 0); |
| 204 | const QModelIndex folder_index = folder->index(); | 212 | const QModelIndex folder_index = folder->index(); |
| 205 | const int children_count = folder->rowCount(); | 213 | const int children_count = folder->rowCount(); |
| @@ -280,6 +288,13 @@ void GameList::OnUpdateThemedIcons() { | |||
| 280 | .scaled(icon_size, icon_size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation), | 288 | .scaled(icon_size, icon_size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation), |
| 281 | Qt::DecorationRole); | 289 | Qt::DecorationRole); |
| 282 | break; | 290 | break; |
| 291 | case GameListItemType::Favorites: | ||
| 292 | child->setData( | ||
| 293 | QIcon::fromTheme(QStringLiteral("star")) | ||
| 294 | .pixmap(icon_size) | ||
| 295 | .scaled(icon_size, icon_size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation), | ||
| 296 | Qt::DecorationRole); | ||
| 297 | break; | ||
| 283 | default: | 298 | default: |
| 284 | break; | 299 | break; |
| 285 | } | 300 | } |
| @@ -427,6 +442,13 @@ void GameList::DonePopulating(const QStringList& watch_list) { | |||
| 427 | emit ShowList(!IsEmpty()); | 442 | emit ShowList(!IsEmpty()); |
| 428 | 443 | ||
| 429 | item_model->invisibleRootItem()->appendRow(new GameListAddDir()); | 444 | item_model->invisibleRootItem()->appendRow(new GameListAddDir()); |
| 445 | item_model->invisibleRootItem()->insertRow(0, new GameListFavorites()); | ||
| 446 | tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(), | ||
| 447 | UISettings::values.favorited_ids.size() == 0); | ||
| 448 | tree_view->expand(item_model->invisibleRootItem()->child(0)->index()); | ||
| 449 | for (const auto id : UISettings::values.favorited_ids) { | ||
| 450 | AddFavorite(id); | ||
| 451 | } | ||
| 430 | 452 | ||
| 431 | // Clear out the old directories to watch for changes and add the new ones | 453 | // Clear out the old directories to watch for changes and add the new ones |
| 432 | auto watch_dirs = watcher->directories(); | 454 | auto watch_dirs = watcher->directories(); |
| @@ -446,7 +468,7 @@ void GameList::DonePopulating(const QStringList& watch_list) { | |||
| 446 | tree_view->setEnabled(true); | 468 | tree_view->setEnabled(true); |
| 447 | const int folder_count = tree_view->model()->rowCount(); | 469 | const int folder_count = tree_view->model()->rowCount(); |
| 448 | int children_total = 0; | 470 | int children_total = 0; |
| 449 | for (int i = 0; i < folder_count; ++i) { | 471 | for (int i = 1; i < folder_count; ++i) { |
| 450 | children_total += item_model->item(i, 0)->rowCount(); | 472 | children_total += item_model->item(i, 0)->rowCount(); |
| 451 | } | 473 | } |
| 452 | search_field->setFilterResult(children_total, children_total); | 474 | search_field->setFilterResult(children_total, children_total); |
| @@ -478,6 +500,9 @@ void GameList::PopupContextMenu(const QPoint& menu_location) { | |||
| 478 | case GameListItemType::SysNandDir: | 500 | case GameListItemType::SysNandDir: |
| 479 | AddPermDirPopup(context_menu, selected); | 501 | AddPermDirPopup(context_menu, selected); |
| 480 | break; | 502 | break; |
| 503 | case GameListItemType::Favorites: | ||
| 504 | AddFavoritesPopup(context_menu); | ||
| 505 | break; | ||
| 481 | default: | 506 | default: |
| 482 | break; | 507 | break; |
| 483 | } | 508 | } |
| @@ -485,6 +510,8 @@ void GameList::PopupContextMenu(const QPoint& menu_location) { | |||
| 485 | } | 510 | } |
| 486 | 511 | ||
| 487 | void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::string& path) { | 512 | void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::string& path) { |
| 513 | QAction* favorite = context_menu.addAction(tr("Favorite")); | ||
| 514 | context_menu.addSeparator(); | ||
| 488 | QAction* open_save_location = context_menu.addAction(tr("Open Save Data Location")); | 515 | QAction* open_save_location = context_menu.addAction(tr("Open Save Data Location")); |
| 489 | QAction* open_mod_location = context_menu.addAction(tr("Open Mod Data Location")); | 516 | QAction* open_mod_location = context_menu.addAction(tr("Open Mod Data Location")); |
| 490 | QAction* open_transferable_shader_cache = | 517 | QAction* open_transferable_shader_cache = |
| @@ -503,6 +530,9 @@ void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::stri | |||
| 503 | context_menu.addSeparator(); | 530 | context_menu.addSeparator(); |
| 504 | QAction* properties = context_menu.addAction(tr("Properties")); | 531 | QAction* properties = context_menu.addAction(tr("Properties")); |
| 505 | 532 | ||
| 533 | favorite->setVisible(program_id != 0); | ||
| 534 | favorite->setCheckable(true); | ||
| 535 | favorite->setChecked(UISettings::values.favorited_ids.contains(program_id)); | ||
| 506 | open_save_location->setVisible(program_id != 0); | 536 | open_save_location->setVisible(program_id != 0); |
| 507 | open_mod_location->setVisible(program_id != 0); | 537 | open_mod_location->setVisible(program_id != 0); |
| 508 | open_transferable_shader_cache->setVisible(program_id != 0); | 538 | open_transferable_shader_cache->setVisible(program_id != 0); |
| @@ -513,6 +543,7 @@ void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::stri | |||
| 513 | auto it = FindMatchingCompatibilityEntry(compatibility_list, program_id); | 543 | auto it = FindMatchingCompatibilityEntry(compatibility_list, program_id); |
| 514 | navigate_to_gamedb_entry->setVisible(it != compatibility_list.end() && program_id != 0); | 544 | navigate_to_gamedb_entry->setVisible(it != compatibility_list.end() && program_id != 0); |
| 515 | 545 | ||
| 546 | connect(favorite, &QAction::triggered, [this, program_id]() { ToggleFavorite(program_id); }); | ||
| 516 | connect(open_save_location, &QAction::triggered, [this, program_id, path]() { | 547 | connect(open_save_location, &QAction::triggered, [this, program_id, path]() { |
| 517 | emit OpenFolderRequested(program_id, GameListOpenTarget::SaveData, path); | 548 | emit OpenFolderRequested(program_id, GameListOpenTarget::SaveData, path); |
| 518 | }); | 549 | }); |
| @@ -576,7 +607,7 @@ void GameList::AddPermDirPopup(QMenu& context_menu, QModelIndex selected) { | |||
| 576 | 607 | ||
| 577 | const int row = selected.row(); | 608 | const int row = selected.row(); |
| 578 | 609 | ||
| 579 | move_up->setEnabled(row > 0); | 610 | move_up->setEnabled(row > 1); |
| 580 | move_down->setEnabled(row < item_model->rowCount() - 2); | 611 | move_down->setEnabled(row < item_model->rowCount() - 2); |
| 581 | 612 | ||
| 582 | connect(move_up, &QAction::triggered, [this, selected, row, game_dir_index] { | 613 | connect(move_up, &QAction::triggered, [this, selected, row, game_dir_index] { |
| @@ -614,6 +645,18 @@ void GameList::AddPermDirPopup(QMenu& context_menu, QModelIndex selected) { | |||
| 614 | }); | 645 | }); |
| 615 | } | 646 | } |
| 616 | 647 | ||
| 648 | void GameList::AddFavoritesPopup(QMenu& context_menu) { | ||
| 649 | QAction* clear_all = context_menu.addAction(tr("Clear")); | ||
| 650 | |||
| 651 | connect(clear_all, &QAction::triggered, [this] { | ||
| 652 | for (const auto id : UISettings::values.favorited_ids) { | ||
| 653 | RemoveFavorite(id); | ||
| 654 | } | ||
| 655 | UISettings::values.favorited_ids.clear(); | ||
| 656 | tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(), true); | ||
| 657 | }); | ||
| 658 | } | ||
| 659 | |||
| 617 | void GameList::LoadCompatibilityList() { | 660 | void GameList::LoadCompatibilityList() { |
| 618 | QFile compat_list{QStringLiteral(":compatibility_list/compatibility_list.json")}; | 661 | QFile compat_list{QStringLiteral(":compatibility_list/compatibility_list.json")}; |
| 619 | 662 | ||
| @@ -728,6 +771,58 @@ void GameList::RefreshGameDirectory() { | |||
| 728 | } | 771 | } |
| 729 | } | 772 | } |
| 730 | 773 | ||
| 774 | void GameList::ToggleFavorite(u64 program_id) { | ||
| 775 | if (!UISettings::values.favorited_ids.contains(program_id)) { | ||
| 776 | tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(), | ||
| 777 | !search_field->isEmpty()); | ||
| 778 | UISettings::values.favorited_ids.append(program_id); | ||
| 779 | AddFavorite(program_id); | ||
| 780 | item_model->sort(tree_view->header()->sortIndicatorSection(), | ||
| 781 | tree_view->header()->sortIndicatorOrder()); | ||
| 782 | } else { | ||
| 783 | UISettings::values.favorited_ids.removeOne(program_id); | ||
| 784 | RemoveFavorite(program_id); | ||
| 785 | if (UISettings::values.favorited_ids.size() == 0) { | ||
| 786 | tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(), true); | ||
| 787 | } | ||
| 788 | } | ||
| 789 | } | ||
| 790 | |||
| 791 | void GameList::AddFavorite(u64 program_id) { | ||
| 792 | auto* favorites_row = item_model->item(0); | ||
| 793 | |||
| 794 | for (int i = 1; i < item_model->rowCount() - 1; i++) { | ||
| 795 | const auto* folder = item_model->item(i); | ||
| 796 | for (int j = 0; j < folder->rowCount(); j++) { | ||
| 797 | if (folder->child(j)->data(GameListItemPath::ProgramIdRole).toULongLong() == | ||
| 798 | program_id) { | ||
| 799 | QList<QStandardItem*> list; | ||
| 800 | for (int k = 0; k < item_model->columnCount(); k++) { | ||
| 801 | list.append(folder->child(j, k)->clone()); | ||
| 802 | } | ||
| 803 | list[0]->setData(folder->child(j)->data(GameListItem::SortRole), | ||
| 804 | GameListItem::SortRole); | ||
| 805 | list[0]->setText(folder->child(j)->data(Qt::DisplayRole).toString()); | ||
| 806 | |||
| 807 | favorites_row->appendRow(list); | ||
| 808 | return; | ||
| 809 | } | ||
| 810 | } | ||
| 811 | } | ||
| 812 | } | ||
| 813 | |||
| 814 | void GameList::RemoveFavorite(u64 program_id) { | ||
| 815 | auto* favorites_row = item_model->item(0); | ||
| 816 | |||
| 817 | for (int i = 0; i < favorites_row->rowCount(); i++) { | ||
| 818 | const auto* game = favorites_row->child(i); | ||
| 819 | if (game->data(GameListItemPath::ProgramIdRole).toULongLong() == program_id) { | ||
| 820 | favorites_row->removeRow(i); | ||
| 821 | return; | ||
| 822 | } | ||
| 823 | } | ||
| 824 | } | ||
| 825 | |||
| 731 | GameListPlaceholder::GameListPlaceholder(GMainWindow* parent) : QWidget{parent} { | 826 | GameListPlaceholder::GameListPlaceholder(GMainWindow* parent) : QWidget{parent} { |
| 732 | connect(parent, &GMainWindow::UpdateThemedIcons, this, | 827 | connect(parent, &GMainWindow::UpdateThemedIcons, this, |
| 733 | &GameListPlaceholder::onUpdateThemedIcons); | 828 | &GameListPlaceholder::onUpdateThemedIcons); |
diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h index 58059a3c4..9c0a1a482 100644 --- a/src/yuzu/game_list.h +++ b/src/yuzu/game_list.h | |||
| @@ -112,10 +112,15 @@ private: | |||
| 112 | 112 | ||
| 113 | void RefreshGameDirectory(); | 113 | void RefreshGameDirectory(); |
| 114 | 114 | ||
| 115 | void ToggleFavorite(u64 program_id); | ||
| 116 | void AddFavorite(u64 program_id); | ||
| 117 | void RemoveFavorite(u64 program_id); | ||
| 118 | |||
| 115 | void PopupContextMenu(const QPoint& menu_location); | 119 | void PopupContextMenu(const QPoint& menu_location); |
| 116 | void AddGamePopup(QMenu& context_menu, u64 program_id, const std::string& path); | 120 | void AddGamePopup(QMenu& context_menu, u64 program_id, const std::string& path); |
| 117 | void AddCustomDirPopup(QMenu& context_menu, QModelIndex selected); | 121 | void AddCustomDirPopup(QMenu& context_menu, QModelIndex selected); |
| 118 | void AddPermDirPopup(QMenu& context_menu, QModelIndex selected); | 122 | void AddPermDirPopup(QMenu& context_menu, QModelIndex selected); |
| 123 | void AddFavoritesPopup(QMenu& context_menu); | ||
| 119 | 124 | ||
| 120 | std::shared_ptr<FileSys::VfsFilesystem> vfs; | 125 | std::shared_ptr<FileSys::VfsFilesystem> vfs; |
| 121 | FileSys::ManualContentProvider* provider; | 126 | FileSys::ManualContentProvider* provider; |
diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h index f25445f18..7ca8ece23 100644 --- a/src/yuzu/game_list_p.h +++ b/src/yuzu/game_list_p.h | |||
| @@ -29,7 +29,8 @@ enum class GameListItemType { | |||
| 29 | SdmcDir = QStandardItem::UserType + 3, | 29 | SdmcDir = QStandardItem::UserType + 3, |
| 30 | UserNandDir = QStandardItem::UserType + 4, | 30 | UserNandDir = QStandardItem::UserType + 4, |
| 31 | SysNandDir = QStandardItem::UserType + 5, | 31 | SysNandDir = QStandardItem::UserType + 5, |
| 32 | AddDir = QStandardItem::UserType + 6 | 32 | AddDir = QStandardItem::UserType + 6, |
| 33 | Favorites = QStandardItem::UserType + 7, | ||
| 33 | }; | 34 | }; |
| 34 | 35 | ||
| 35 | Q_DECLARE_METATYPE(GameListItemType); | 36 | Q_DECLARE_METATYPE(GameListItemType); |
| @@ -310,6 +311,28 @@ public: | |||
| 310 | } | 311 | } |
| 311 | }; | 312 | }; |
| 312 | 313 | ||
| 314 | class GameListFavorites : public GameListItem { | ||
| 315 | public: | ||
| 316 | explicit GameListFavorites() { | ||
| 317 | setData(type(), TypeRole); | ||
| 318 | |||
| 319 | const int icon_size = std::min(static_cast<int>(UISettings::values.icon_size), 64); | ||
| 320 | setData(QIcon::fromTheme(QStringLiteral("star")) | ||
| 321 | .pixmap(icon_size) | ||
| 322 | .scaled(icon_size, icon_size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation), | ||
| 323 | Qt::DecorationRole); | ||
| 324 | setData(QObject::tr("Favorites"), Qt::DisplayRole); | ||
| 325 | } | ||
| 326 | |||
| 327 | int type() const override { | ||
| 328 | return static_cast<int>(GameListItemType::Favorites); | ||
| 329 | } | ||
| 330 | |||
| 331 | bool operator<(const QStandardItem& other) const override { | ||
| 332 | return false; | ||
| 333 | } | ||
| 334 | }; | ||
| 335 | |||
| 313 | class GameList; | 336 | class GameList; |
| 314 | class QHBoxLayout; | 337 | class QHBoxLayout; |
| 315 | class QTreeView; | 338 | class QTreeView; |
| @@ -324,6 +347,7 @@ public: | |||
| 324 | explicit GameListSearchField(GameList* parent = nullptr); | 347 | explicit GameListSearchField(GameList* parent = nullptr); |
| 325 | 348 | ||
| 326 | void setFilterResult(int visible, int total); | 349 | void setFilterResult(int visible, int total); |
| 350 | bool isEmpty() const; | ||
| 327 | 351 | ||
| 328 | void clear(); | 352 | void clear(); |
| 329 | void setFocus(); | 353 | void setFocus(); |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 5f6cdc0c6..39bdf186d 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -349,7 +349,7 @@ GMainWindow::GMainWindow() | |||
| 349 | continue; | 349 | continue; |
| 350 | } | 350 | } |
| 351 | 351 | ||
| 352 | Settings::values.current_user = selected_user; | 352 | Settings::values.current_user = static_cast<s32>(selected_user); |
| 353 | continue; | 353 | continue; |
| 354 | } | 354 | } |
| 355 | 355 | ||
diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h index ce3945485..5ba00b8c8 100644 --- a/src/yuzu/uisettings.h +++ b/src/yuzu/uisettings.h | |||
| @@ -74,6 +74,7 @@ struct Values { | |||
| 74 | QString game_dir_deprecated; | 74 | QString game_dir_deprecated; |
| 75 | bool game_dir_deprecated_deepscan; | 75 | bool game_dir_deprecated_deepscan; |
| 76 | QVector<UISettings::GameDir> game_dirs; | 76 | QVector<UISettings::GameDir> game_dirs; |
| 77 | QVector<u64> favorited_ids; | ||
| 77 | QStringList recent_files; | 78 | QStringList recent_files; |
| 78 | QString language; | 79 | QString language; |
| 79 | 80 | ||
diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txt index 8461f8896..4bf25727b 100644 --- a/src/yuzu_cmd/CMakeLists.txt +++ b/src/yuzu_cmd/CMakeLists.txt | |||
| @@ -20,7 +20,6 @@ add_executable(yuzu-cmd | |||
| 20 | emu_window/emu_window_sdl2_gl.h | 20 | emu_window/emu_window_sdl2_gl.h |
| 21 | emu_window/emu_window_sdl2_vk.cpp | 21 | emu_window/emu_window_sdl2_vk.cpp |
| 22 | emu_window/emu_window_sdl2_vk.h | 22 | emu_window/emu_window_sdl2_vk.h |
| 23 | resource.h | ||
| 24 | yuzu.cpp | 23 | yuzu.cpp |
| 25 | yuzu.rc | 24 | yuzu.rc |
| 26 | ) | 25 | ) |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp index 3bb555a6b..d64f81106 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | |||
| @@ -238,6 +238,6 @@ void EmuWindow_SDL2::SetWindowIcon() { | |||
| 238 | SDL_FreeSurface(window_icon); | 238 | SDL_FreeSurface(window_icon); |
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | void EmuWindow_SDL2::OnMinimalClientAreaChangeRequest(std::pair<unsigned, unsigned> minimal_size) { | 241 | void EmuWindow_SDL2::OnMinimalClientAreaChangeRequest(std::pair<u32, u32> minimal_size) { |
| 242 | SDL_SetWindowMinimumSize(render_window, minimal_size.first, minimal_size.second); | 242 | SDL_SetWindowMinimumSize(render_window, minimal_size.first, minimal_size.second); |
| 243 | } | 243 | } |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.h b/src/yuzu_cmd/emu_window/emu_window_sdl2.h index 0e17bbca7..1b9ab5b93 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.h +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.h | |||
| @@ -71,7 +71,7 @@ protected: | |||
| 71 | void Fullscreen(); | 71 | void Fullscreen(); |
| 72 | 72 | ||
| 73 | /// Called when a configuration change affects the minimal size of the window | 73 | /// Called when a configuration change affects the minimal size of the window |
| 74 | void OnMinimalClientAreaChangeRequest(std::pair<unsigned, unsigned> minimal_size) override; | 74 | void OnMinimalClientAreaChangeRequest(std::pair<u32, u32> minimal_size) override; |
| 75 | 75 | ||
| 76 | /// Is the window still open? | 76 | /// Is the window still open? |
| 77 | bool is_open = true; | 77 | bool is_open = true; |
diff --git a/src/yuzu_cmd/resource.h b/src/yuzu_cmd/resource.h deleted file mode 100644 index df8e459e4..000000000 --- a/src/yuzu_cmd/resource.h +++ /dev/null | |||
| @@ -1,16 +0,0 @@ | |||
| 1 | //{{NO_DEPENDENCIES}} | ||
| 2 | // Microsoft Visual C++ generated include file. | ||
| 3 | // Used by pcafe.rc | ||
| 4 | // | ||
| 5 | #define IDI_ICON3 103 | ||
| 6 | |||
| 7 | // Next default values for new objects | ||
| 8 | // | ||
| 9 | #ifdef APSTUDIO_INVOKED | ||
| 10 | #ifndef APSTUDIO_READONLY_SYMBOLS | ||
| 11 | #define _APS_NEXT_RESOURCE_VALUE 105 | ||
| 12 | #define _APS_NEXT_COMMAND_VALUE 40001 | ||
| 13 | #define _APS_NEXT_CONTROL_VALUE 1001 | ||
| 14 | #define _APS_NEXT_SYMED_VALUE 101 | ||
| 15 | #endif | ||
| 16 | #endif | ||