merge latest master changes
|
@ -945,7 +945,7 @@ file(WRITE ${PROJECT_BINARY_DIR}/Source/Core/Common/scmrev.h
|
|||
"#define SCM_IS_MASTER " ${DOLPHIN_WC_IS_STABLE} "\n"
|
||||
"#define SCM_DISTRIBUTOR_STR \"" ${DISTRIBUTOR} "\"\n"
|
||||
)
|
||||
include_directories("${PROJECT_BINARY_DIR}/Source/Core/Common")
|
||||
include_directories("${PROJECT_BINARY_DIR}/Source/Core")
|
||||
|
||||
########################################
|
||||
# Unit testing.
|
||||
|
|
Before Width: | Height: | Size: 722 B After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 651 B After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 412 B After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 988 B After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 988 B After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 988 B After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 988 B After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 988 B After Width: | Height: | Size: 2.9 KiB |
|
@ -1 +0,0 @@
|
|||
Boomy: Milosz Wlazlo [miloszwl@miloszwl.com]
|
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.2 KiB |
|
@ -11,8 +11,8 @@ msgstr ""
|
|||
"Project-Id-Version: Dolphin Emulator\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-06-19 04:24+0200\n"
|
||||
"PO-Revision-Date: 2016-06-19 02:25+0000\n"
|
||||
"Last-Translator: Pierre Bourdon <delroth@gmail.com>\n"
|
||||
"PO-Revision-Date: 2016-06-24 09:16+0000\n"
|
||||
"Last-Translator: mansoor <asseryma@hotmail.com>\n"
|
||||
"Language-Team: Arabic (http://www.transifex.com/delroth/dolphin-emu/language/"
|
||||
"ar/)\n"
|
||||
"Language: ar\n"
|
||||
|
@ -30,9 +30,9 @@ msgid ""
|
|||
"This software should not be used to play games you do not legally own.\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Dolphin is a free and open-source GameCube and Wii emulator.\n"
|
||||
"محاكي الدولفين مفتوح المصدر لجهاز الجيم كيوب و الوي .\n"
|
||||
"\n"
|
||||
"This software should not be used to play games you do not legally own.\n"
|
||||
"لا ينبغي أن تستخدم هذا البرنامج للعب الألعاب المقرصنة.\n"
|
||||
|
||||
#: Source/Core/DolphinWX/NetPlay/NetWindow.cpp:538
|
||||
msgid " (internal IP)"
|
||||
|
@ -1372,7 +1372,7 @@ msgstr "توصيل"
|
|||
|
||||
#: Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp:57
|
||||
msgid "Connection Type:"
|
||||
msgstr ""
|
||||
msgstr "نوع الاتصال:"
|
||||
|
||||
#: Source/Core/DolphinWX/ControllerConfigDiag.cpp:266
|
||||
msgid "Continuous Scanning"
|
||||
|
@ -1745,7 +1745,7 @@ msgstr "تقوم بتعتيم الشاشة بعد خمس دقائق من الخ
|
|||
|
||||
#: Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp:61
|
||||
msgid "Direct Connection"
|
||||
msgstr ""
|
||||
msgstr "اتصال مباشر"
|
||||
|
||||
#: Source/Core/Core/HW/GCMemcard.cpp:133
|
||||
msgid "Directory checksum and directory backup checksum failed"
|
||||
|
@ -1884,6 +1884,8 @@ msgid ""
|
|||
"Dolphin could not find any GameCube/Wii ISOs or WADs. Double-click here to "
|
||||
"set a games directory..."
|
||||
msgstr ""
|
||||
"دولفين لم يتم العثور على أي قرص جيم كيوب / الوي . انقر نقرا مزدوجا فوق هنا "
|
||||
"لوضع دليل الألعاب ..."
|
||||
|
||||
#: Source/Core/DolphinWX/GameListCtrl.cpp:328
|
||||
msgid ""
|
||||
|
@ -2132,7 +2134,7 @@ msgstr "تمكين بيانات مكبر صوت"
|
|||
|
||||
#: Source/Core/DolphinWX/Config/GeneralConfigPane.cpp:61
|
||||
msgid "Enable Usage Statistics Reporting"
|
||||
msgstr ""
|
||||
msgstr "تمكين تقارير إحصائيات الاستخدام "
|
||||
|
||||
#: Source/Core/DolphinWX/ISOProperties.cpp:347
|
||||
msgid "Enable WideScreen"
|
||||
|
@ -2243,6 +2245,9 @@ msgid ""
|
|||
"understand how our users interact with the system. No private data is ever "
|
||||
"collected."
|
||||
msgstr ""
|
||||
"تمكن جمع وتبادل البيانات الإحصائية استخدام مع فريق التطوير دولفين . وتستخدم "
|
||||
"هذه البيانات لتحسين المضاهاة و تساعدنا على فهم كيفية تفاعل المستخدمين مع "
|
||||
"النظام. لا توجد بيانات خاصه يتم جمعها ."
|
||||
|
||||
#: Source/Core/DolphinWX/Config/GeneralConfigPane.cpp:68
|
||||
msgid "Enables the use of Action Replay and Gecko cheats."
|
||||
|
@ -3032,7 +3037,7 @@ msgstr "الإعدادات العامة"
|
|||
|
||||
#: Source/Core/DolphinWX/Config/GeneralConfigPane.cpp:62
|
||||
msgid "Generate a New Statistics Identity"
|
||||
msgstr ""
|
||||
msgstr "إنشاء هوية جديد للحصائيات "
|
||||
|
||||
#: Source/Core/DolphinWX/Config/GameCubeConfigPane.cpp:50
|
||||
#: Source/Core/DolphinWX/Config/WiiConfigPane.cpp:33
|
||||
|
@ -3227,7 +3232,7 @@ msgstr " أيقونة"
|
|||
|
||||
#: Source/Core/DolphinWX/Config/GeneralConfigPane.cpp:193
|
||||
msgid "Identity generation"
|
||||
msgstr ""
|
||||
msgstr "إنشاء هوية"
|
||||
|
||||
#: Source/Core/DolphinWX/Main.cpp:273
|
||||
msgid ""
|
||||
|
@ -3243,6 +3248,16 @@ msgid ""
|
|||
"\n"
|
||||
"Do you authorize Dolphin to report this information to Dolphin's developers?"
|
||||
msgstr ""
|
||||
"إذا أذن ، يمكن دولفين جمع بيانات عن أدائها ، واستخدام ميزة ، و الاعدادات، "
|
||||
"فضلا عن بيانات عن نظام التشغيل الخاص بك .\n"
|
||||
"\n"
|
||||
"لا توجد بيانات خاصة يتم جمعها . هذه البيانات تساعدنا على فهم كيف يمكن للناس "
|
||||
"و ألعاب محاكاة استخدام دولفين و أولويات جهودنا . كما أنه يساعد لنا تحديد "
|
||||
"اعدادات نادرة التي تسبب قضايا الخلل والأداء و الاستقرار .\n"
|
||||
"هذا التفويض يمكن إلغاؤه في أي وقت من خلال إعدادات دولفين .\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"هل توافق لدولفين أن يبلغ هذه المعلومات للمطورين دولفين ؟"
|
||||
|
||||
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:475
|
||||
msgid "Ignore Format Changes"
|
||||
|
@ -4136,7 +4151,7 @@ msgstr "بحث جديد"
|
|||
|
||||
#: Source/Core/DolphinWX/Config/GeneralConfigPane.cpp:193
|
||||
msgid "New identity generated."
|
||||
msgstr ""
|
||||
msgstr "تم إنشاء هوية جديدة ."
|
||||
|
||||
#: Source/Core/DolphinWX/MemcardManager.cpp:211
|
||||
#: Source/Core/DolphinWX/MemcardManager.cpp:822
|
||||
|
@ -4149,7 +4164,7 @@ msgstr "البحث التالي"
|
|||
|
||||
#: Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp:76
|
||||
msgid "Nickname:"
|
||||
msgstr ""
|
||||
msgstr "الاسم:"
|
||||
|
||||
#: Source/Core/Core/ConfigManager.h:18
|
||||
msgid "No audio output"
|
||||
|
@ -4535,7 +4550,7 @@ msgstr "خروج"
|
|||
|
||||
#: Source/Core/DolphinWX/NetPlay/NetWindow.cpp:207
|
||||
msgid "Quit Netplay"
|
||||
msgstr ""
|
||||
msgstr "الخروج من لعب الشبكه"
|
||||
|
||||
#. i18n: Right
|
||||
#: Source/Core/Core/HW/GCPadEmu.cpp:48
|
||||
|
@ -4588,7 +4603,7 @@ msgstr "تسجيل"
|
|||
|
||||
#: Source/Core/DolphinWX/NetPlay/NetWindow.cpp:229
|
||||
msgid "Record inputs"
|
||||
msgstr ""
|
||||
msgstr "تسجيل المدخلات"
|
||||
|
||||
#: Source/Core/DolphinWX/FifoPlayerDlg.cpp:156
|
||||
msgid "Recording Info"
|
||||
|
@ -4723,7 +4738,7 @@ msgstr "العصا الايمن"
|
|||
|
||||
#: Source/Core/DolphinWX/NetPlay/NetWindow.cpp:169
|
||||
msgid "Room ID:"
|
||||
msgstr ""
|
||||
msgstr "معرف الغرفة:"
|
||||
|
||||
#: Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp:293
|
||||
#: Source/Core/Core/HW/GCPadEmu.cpp:74
|
||||
|
@ -5739,7 +5754,7 @@ msgstr ""
|
|||
#: Source/Core/DiscIO/CompressedBlob.cpp:102
|
||||
#, c-format
|
||||
msgid "The disc image \"%s\" is truncated, some of the data is missing."
|
||||
msgstr ""
|
||||
msgstr "The disc image \"%s\" is truncated, some of the data is missing."
|
||||
|
||||
#: Source/Core/DolphinWX/GameListCtrl.cpp:1204
|
||||
#: Source/Core/DolphinWX/GameListCtrl.cpp:1232
|
||||
|
@ -6004,11 +6019,11 @@ msgstr "الصينية التقليدية"
|
|||
|
||||
#: Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp:62
|
||||
msgid "Traversal Server"
|
||||
msgstr ""
|
||||
msgstr "اجتياز الخادم"
|
||||
|
||||
#: Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp:102
|
||||
msgid "Traversal Server:"
|
||||
msgstr ""
|
||||
msgstr "اجتياز الخادم:"
|
||||
|
||||
#: Source/Core/Core/NetPlayClient.cpp:835
|
||||
msgid "Traversal server timed out connecting to the host"
|
||||
|
@ -6166,11 +6181,11 @@ msgstr "ويموت مستقيم"
|
|||
|
||||
#: Source/Core/DolphinWX/Config/GeneralConfigPane.cpp:93
|
||||
msgid "Usage Statistics Reporting Settings"
|
||||
msgstr ""
|
||||
msgstr "إعدادات تقارير إحصائيات الاستخدام "
|
||||
|
||||
#: Source/Core/DolphinWX/Main.cpp:284
|
||||
msgid "Usage statistics reporting"
|
||||
msgstr ""
|
||||
msgstr "الإبلاغ عن إحصائيات الاستخدام "
|
||||
|
||||
#: Source/Core/DolphinWX/Config/GeneralConfigPane.cpp:71
|
||||
msgid ""
|
||||
|
@ -6178,6 +6193,8 @@ msgid ""
|
|||
"distinguish users from one another. This button generates a new random "
|
||||
"identifier for this machine which is dissociated from the previous one."
|
||||
msgstr ""
|
||||
"يستخدم التقرير إحصائيات الاستخدام فريدة من نوعها عشوائي معرف لكل جهاز لتمييز "
|
||||
"المستخدمين من بعضها البعض . هذا الزر يولد معرف عشوائي جديد لهذا الجهاز ."
|
||||
|
||||
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:304
|
||||
msgid "Use Fullscreen"
|
||||
|
@ -6521,7 +6538,7 @@ msgstr "الكتابة إلى نافذة"
|
|||
|
||||
#: Source/Core/DolphinWX/NetPlay/NetWindow.cpp:224
|
||||
msgid "Write to memcards/SD"
|
||||
msgstr ""
|
||||
msgstr "Write to memcards/SD"
|
||||
|
||||
#: Source/Core/DolphinWX/TASInputDlg.cpp:454
|
||||
msgid "X"
|
||||
|
|
|
@ -14,7 +14,7 @@ msgstr ""
|
|||
"Project-Id-Version: Dolphin Emulator\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-06-19 04:24+0200\n"
|
||||
"PO-Revision-Date: 2016-06-23 18:00+0000\n"
|
||||
"PO-Revision-Date: 2016-06-24 10:49+0000\n"
|
||||
"Last-Translator: Puniasterus <puniasterus@gmail.com>\n"
|
||||
"Language-Team: Catalan (http://www.transifex.com/delroth/dolphin-emu/"
|
||||
"language/ca/)\n"
|
||||
|
@ -405,7 +405,7 @@ msgstr ""
|
|||
|
||||
#: Source/Core/DolphinWX/NetPlay/NetWindow.cpp:65
|
||||
msgid "(Error: Unknown)"
|
||||
msgstr ""
|
||||
msgstr "(Error: Desconegut)"
|
||||
|
||||
#: Source/Core/DolphinWX/AboutDolphin.cpp:33
|
||||
msgid ""
|
||||
|
@ -490,7 +490,7 @@ msgstr "<Idioma del sistema>"
|
|||
#: Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp:320
|
||||
#: Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp:384
|
||||
msgid "A NetPlay window is already open!"
|
||||
msgstr ""
|
||||
msgstr "Una finestra NetPlay ja està oberta!"
|
||||
|
||||
#: Source/Core/DolphinWX/Cheats/CheatSearchTab.cpp:121
|
||||
#: Source/Core/DolphinWX/Cheats/CheatSearchTab.cpp:151
|
||||
|
@ -660,7 +660,7 @@ msgstr "Afegir..."
|
|||
|
||||
#: Source/Core/DolphinWX/Cheats/CheatSearchTab.cpp:316
|
||||
msgid "Address"
|
||||
msgstr ""
|
||||
msgstr "Adreça"
|
||||
|
||||
#: Source/Core/DolphinWX/InputConfigDiag.cpp:850
|
||||
msgid "Adjust the analog control pressure required to activate buttons."
|
||||
|
@ -1318,7 +1318,7 @@ msgstr "Connectant..."
|
|||
|
||||
#: Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp:57
|
||||
msgid "Connection Type:"
|
||||
msgstr ""
|
||||
msgstr "Tipus de connexió:"
|
||||
|
||||
#: Source/Core/DolphinWX/ControllerConfigDiag.cpp:266
|
||||
msgid "Continuous Scanning"
|
||||
|
@ -1958,7 +1958,7 @@ msgstr ""
|
|||
|
||||
#: Source/Core/Core/State.cpp:466
|
||||
msgid "Empty"
|
||||
msgstr ""
|
||||
msgstr "Buit"
|
||||
|
||||
#: Source/Core/Core/Core.cpp:233
|
||||
msgid "Emu Thread already running"
|
||||
|
@ -2357,7 +2357,7 @@ msgstr "Mida FST:"
|
|||
|
||||
#: Source/Core/Core/NetPlayClient.cpp:159
|
||||
msgid "Failed To Connect!"
|
||||
msgstr ""
|
||||
msgstr "No s'ha pogut connectar"
|
||||
|
||||
#: Source/Core/Core/NetPlayClient.cpp:103
|
||||
msgid "Failed to Connect!"
|
||||
|
@ -2501,7 +2501,7 @@ msgstr ""
|
|||
|
||||
#: Source/Core/DolphinWX/GameListCtrl.cpp:267
|
||||
msgid "File"
|
||||
msgstr ""
|
||||
msgstr "Arxiu"
|
||||
|
||||
#: Source/Core/DolphinWX/FifoPlayerDlg.cpp:81
|
||||
msgid "File Info"
|
||||
|
@ -2509,7 +2509,7 @@ msgstr "informació del fitxer"
|
|||
|
||||
#: Source/Core/DolphinWX/FrameTools.cpp:349
|
||||
msgid "File Name"
|
||||
msgstr ""
|
||||
msgstr "Nom de l'arxiu"
|
||||
|
||||
#: Source/Core/DolphinWX/FrameTools.cpp:355
|
||||
msgid "File Size"
|
||||
|
@ -2657,12 +2657,12 @@ msgstr ""
|
|||
#: Source/Core/DolphinWX/FifoPlayerDlg.cpp:885
|
||||
#, c-format
|
||||
msgid "Frame %u"
|
||||
msgstr ""
|
||||
msgstr "Fotograma %u"
|
||||
|
||||
#: Source/Core/DolphinWX/FifoPlayerDlg.cpp:861
|
||||
#, c-format
|
||||
msgid "Frame %zu"
|
||||
msgstr ""
|
||||
msgstr "Fotograma %zu"
|
||||
|
||||
#: Source/Core/Core/HotkeyManager.cpp:22
|
||||
msgid "Frame Advance"
|
||||
|
@ -2777,7 +2777,7 @@ msgstr "GBA"
|
|||
|
||||
#: Source/Core/DolphinWX/NetPlay/PadMapDialog.cpp:32
|
||||
msgid "GC Port "
|
||||
msgstr ""
|
||||
msgstr "Port GC"
|
||||
|
||||
#: Source/Core/DolphinWX/MemcardManager.cpp:542
|
||||
msgid "GCI File(*.gci)"
|
||||
|
@ -3376,7 +3376,7 @@ msgstr ""
|
|||
|
||||
#: Source/Core/DolphinWX/NetPlay/NetWindow.cpp:192
|
||||
msgid "Kick Player"
|
||||
msgstr ""
|
||||
msgstr "Expulsar jugador"
|
||||
|
||||
#: Source/Core/DolphinWX/ISOProperties.cpp:156
|
||||
msgid "Korea"
|
||||
|
@ -3751,7 +3751,7 @@ msgstr "Micròfon"
|
|||
|
||||
#: Source/Core/DolphinWX/Config/GameCubeConfigPane.cpp:33
|
||||
msgid "Microphone"
|
||||
msgstr ""
|
||||
msgstr "Micròfon"
|
||||
|
||||
#: Source/Core/DolphinWX/ControllerConfigDiag.cpp:293
|
||||
#: Source/Core/DolphinWX/ControllerConfigDiag.cpp:296
|
||||
|
@ -3927,7 +3927,7 @@ msgstr "Nom:"
|
|||
|
||||
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:351
|
||||
msgid "Native (640x528)"
|
||||
msgstr ""
|
||||
msgstr "Natiu (640x528)"
|
||||
|
||||
#: Source/Core/DolphinWX/MemcardManager.cpp:534
|
||||
#: Source/Core/DolphinWX/MemcardManager.cpp:573
|
||||
|
@ -4050,7 +4050,7 @@ msgstr ""
|
|||
#: Source/Core/DolphinWX/FifoPlayerDlg.cpp:598
|
||||
#, c-format
|
||||
msgid "Object %zu"
|
||||
msgstr ""
|
||||
msgstr "Objecte %zu"
|
||||
|
||||
#: Source/Core/DolphinWX/FifoPlayerDlg.cpp:117
|
||||
msgid "Object Range"
|
||||
|
@ -4273,7 +4273,7 @@ msgstr "Més-Menys"
|
|||
#: Source/Core/DolphinWX/ControllerConfigDiag.cpp:83
|
||||
#, c-format
|
||||
msgid "Port %i"
|
||||
msgstr ""
|
||||
msgstr "Port %i"
|
||||
|
||||
#: Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp:119
|
||||
#: Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp:157
|
||||
|
@ -4495,7 +4495,7 @@ msgstr "Resultats"
|
|||
|
||||
#: Source/Core/DolphinWX/NetPlay/NetWindow.cpp:571
|
||||
msgid "Retry"
|
||||
msgstr ""
|
||||
msgstr "Tornar a intentar"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:21
|
||||
msgid "Return"
|
||||
|
@ -5400,7 +5400,7 @@ msgstr "Capturar pantalla"
|
|||
|
||||
#: Source/Core/DolphinWX/FrameTools.cpp:549
|
||||
msgid "Take screenshot"
|
||||
msgstr ""
|
||||
msgstr "Fer captura de pantalla"
|
||||
|
||||
#: Source/Core/DolphinWX/InputConfigDiag.cpp:577
|
||||
msgid "Test"
|
||||
|
@ -5855,7 +5855,7 @@ msgstr ""
|
|||
|
||||
#: Source/Core/DolphinWX/Config/GeneralConfigPane.cpp:45
|
||||
msgid "Unlimited"
|
||||
msgstr ""
|
||||
msgstr "Il·limitat"
|
||||
|
||||
#: Source/Core/DiscIO/CompressedBlob.cpp:369
|
||||
msgid "Unpacking"
|
||||
|
@ -5965,7 +5965,7 @@ msgstr "Volum"
|
|||
|
||||
#: Source/Core/Core/HotkeyManager.cpp:42
|
||||
msgid "Volume Down"
|
||||
msgstr ""
|
||||
msgstr "Baixar el volum"
|
||||
|
||||
#: Source/Core/Core/HotkeyManager.cpp:44
|
||||
msgid "Volume Toggle Mute"
|
||||
|
@ -5973,7 +5973,7 @@ msgstr ""
|
|||
|
||||
#: Source/Core/Core/HotkeyManager.cpp:43
|
||||
msgid "Volume Up"
|
||||
msgstr ""
|
||||
msgstr "Pujar el volum"
|
||||
|
||||
#: Source/Core/DiscIO/NANDContentLoader.cpp:462
|
||||
#: Source/Core/DiscIO/NANDContentLoader.cpp:486
|
||||
|
|
|
@ -20,8 +20,8 @@ msgstr ""
|
|||
"Project-Id-Version: Dolphin Emulator\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-06-19 04:24+0200\n"
|
||||
"PO-Revision-Date: 2016-06-19 14:13+0000\n"
|
||||
"Last-Translator: Petiso_Carambanal <diegoae@gmail.com>\n"
|
||||
"PO-Revision-Date: 2016-06-24 21:30+0000\n"
|
||||
"Last-Translator: Swyter <Swyterzone@gmail.com>\n"
|
||||
"Language-Team: Spanish (http://www.transifex.com/delroth/dolphin-emu/"
|
||||
"language/es/)\n"
|
||||
"Language: es\n"
|
||||
|
@ -2176,7 +2176,7 @@ msgstr "Activar envío de datos al altavoz"
|
|||
|
||||
#: Source/Core/DolphinWX/Config/GeneralConfigPane.cpp:61
|
||||
msgid "Enable Usage Statistics Reporting"
|
||||
msgstr "Habilitar el uso de informes de estadísticas"
|
||||
msgstr "Informar de estadísticas de uso"
|
||||
|
||||
#: Source/Core/DolphinWX/ISOProperties.cpp:347
|
||||
msgid "Enable WideScreen"
|
||||
|
@ -2288,10 +2288,10 @@ msgid ""
|
|||
"understand how our users interact with the system. No private data is ever "
|
||||
"collected."
|
||||
msgstr ""
|
||||
"Activa la recopilación e intercambio de datos de estadísticas de uso con el "
|
||||
"equipo de desarrollo de Dolphin. Estos datos son utilizados para mejorar el "
|
||||
"emulador y ayudarnos a comprender cómo nuestros usuarios interactúan con el "
|
||||
"sistema. No se recogen datos privados."
|
||||
"Recopila y comparte datos estadísticos sobre el uso de determinadas "
|
||||
"funciones con el equipo que desarrolla Dolphin. Estos datos se utilizan para "
|
||||
"mejorar el emulador y nos ayudan a comprender cómo utilizais el programa. No "
|
||||
"se recogen datos privados."
|
||||
|
||||
#: Source/Core/DolphinWX/Config/GeneralConfigPane.cpp:68
|
||||
msgid "Enables the use of Action Replay and Gecko cheats."
|
||||
|
@ -3092,7 +3092,7 @@ msgstr "Ajustes generales"
|
|||
|
||||
#: Source/Core/DolphinWX/Config/GeneralConfigPane.cpp:62
|
||||
msgid "Generate a New Statistics Identity"
|
||||
msgstr "Generar una nueva identidad estadística"
|
||||
msgstr "Generar un nuevo identificador para estadísticas"
|
||||
|
||||
#: Source/Core/DolphinWX/Config/GameCubeConfigPane.cpp:50
|
||||
#: Source/Core/DolphinWX/Config/WiiConfigPane.cpp:33
|
||||
|
@ -3294,7 +3294,7 @@ msgstr "Icono"
|
|||
|
||||
#: Source/Core/DolphinWX/Config/GeneralConfigPane.cpp:193
|
||||
msgid "Identity generation"
|
||||
msgstr "Generación de la identidad"
|
||||
msgstr "Generación de identidad"
|
||||
|
||||
#: Source/Core/DolphinWX/Main.cpp:273
|
||||
msgid ""
|
||||
|
@ -4227,7 +4227,7 @@ msgstr "Nuevo escaneado"
|
|||
|
||||
#: Source/Core/DolphinWX/Config/GeneralConfigPane.cpp:193
|
||||
msgid "New identity generated."
|
||||
msgstr "Nueva identidad generada."
|
||||
msgstr "Se ha generado un identificador nuevo."
|
||||
|
||||
#: Source/Core/DolphinWX/MemcardManager.cpp:211
|
||||
#: Source/Core/DolphinWX/MemcardManager.cpp:822
|
||||
|
@ -6306,11 +6306,11 @@ msgstr "Wiimote en vertical"
|
|||
|
||||
#: Source/Core/DolphinWX/Config/GeneralConfigPane.cpp:93
|
||||
msgid "Usage Statistics Reporting Settings"
|
||||
msgstr "Configuración del uso de informes de estadísticas"
|
||||
msgstr "Ajustes de envíos estadísticos"
|
||||
|
||||
#: Source/Core/DolphinWX/Main.cpp:284
|
||||
msgid "Usage statistics reporting"
|
||||
msgstr "Estadísticas del uso de informes"
|
||||
msgstr "Enviar informes estadísticos"
|
||||
|
||||
#: Source/Core/DolphinWX/Config/GeneralConfigPane.cpp:71
|
||||
msgid ""
|
||||
|
@ -6318,10 +6318,10 @@ msgid ""
|
|||
"distinguish users from one another. This button generates a new random "
|
||||
"identifier for this machine which is dissociated from the previous one."
|
||||
msgstr ""
|
||||
"Las estadísticas del uso de informes utilizan un identificador único al azar "
|
||||
"por la máquina para distinguir a los usuarios una de la otra. Este botón "
|
||||
"genera un nuevo identificador aleatorio para esta máquina distinto del "
|
||||
"anterior."
|
||||
"Al enviar informes estadísticos utilizamos un identificador (único para este "
|
||||
"equipo) generado al azar con el que distinguir usuarios y dispositivos. Este "
|
||||
"botón te permite cambiarlo generando un identificador nuevo completamente "
|
||||
"separado del anterior."
|
||||
|
||||
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:304
|
||||
msgid "Use Fullscreen"
|
||||
|
|
|
@ -12,7 +12,7 @@ msgstr ""
|
|||
"Project-Id-Version: Dolphin Emulator\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-06-19 04:24+0200\n"
|
||||
"PO-Revision-Date: 2016-06-24 02:44+0000\n"
|
||||
"PO-Revision-Date: 2016-06-29 04:11+0000\n"
|
||||
"Last-Translator: Siegfried <iori3000@hanafos.com>\n"
|
||||
"Language-Team: Korean (http://www.transifex.com/delroth/dolphin-emu/language/"
|
||||
"ko/)\n"
|
||||
|
@ -593,7 +593,7 @@ msgstr ""
|
|||
msgid ""
|
||||
"Action Replay Error: Invalid size (%08x : address = %08x) in Add Code (%s)"
|
||||
msgstr ""
|
||||
"액션 리플레이 에러: 비적합 크기 (%08x : address = %08x) 코드 추가 (%s)에"
|
||||
"액션 리플레이 에러: 부적합 크기 (%08x : address = %08x) 코드 추가 (%s)에"
|
||||
|
||||
#: Source/Core/Core/ActionReplay.cpp:584
|
||||
#, c-format
|
||||
|
@ -601,7 +601,7 @@ msgid ""
|
|||
"Action Replay Error: Invalid size (%08x : address = %08x) in Fill and Slide "
|
||||
"(%s)"
|
||||
msgstr ""
|
||||
"액션 리플레이 에러: 비적합 크기 (%08x : address = %08x) 채우기와 슬라이드(%s)"
|
||||
"액션 리플레이 에러: 부적합 크기 (%08x : address = %08x) 채우기와 슬라이드(%s)"
|
||||
"에"
|
||||
|
||||
#: Source/Core/Core/ActionReplay.cpp:372
|
||||
|
@ -610,7 +610,7 @@ msgid ""
|
|||
"Action Replay Error: Invalid size (%08x : address = %08x) in Ram Write And "
|
||||
"Fill (%s)"
|
||||
msgstr ""
|
||||
"액션 리플레이 에러: 비적합 크기 (%08x : address = %08x) 램 쓰기와 채우기 (%s)"
|
||||
"액션 리플레이 에러: 부적합 크기 (%08x : address = %08x) 램 쓰기와 채우기 (%s)"
|
||||
"에"
|
||||
|
||||
#: Source/Core/Core/ActionReplay.cpp:432
|
||||
|
@ -619,12 +619,12 @@ msgid ""
|
|||
"Action Replay Error: Invalid size (%08x : address = %08x) in Write To "
|
||||
"Pointer (%s)"
|
||||
msgstr ""
|
||||
"액션 리플레이 에러: 비적합 크기 (%08x : address = %08x) 포인터 (%s)에 쓰기에"
|
||||
"액션 리플레이 에러: 부적합 크기 (%08x : address = %08x) 포인터 (%s)에 쓰기에"
|
||||
|
||||
#: Source/Core/Core/ActionReplay.cpp:632
|
||||
#, c-format
|
||||
msgid "Action Replay Error: Invalid value (%08x) in Memory Copy (%s)"
|
||||
msgstr "액션 리플레이 에러: 비적합 크기 (%08x), 메모리 복사 (%s)에"
|
||||
msgstr "액션 리플레이 에러: 부적합 크기 (%08x), 메모리 복사 (%s)에"
|
||||
|
||||
#: Source/Core/Core/ActionReplay.cpp:509
|
||||
#, c-format
|
||||
|
@ -639,7 +639,7 @@ msgstr ""
|
|||
#: Source/Core/Core/ActionReplay.cpp:218
|
||||
#, c-format
|
||||
msgid "Action Replay Error: invalid AR code line: %s"
|
||||
msgstr "액션 리플레이 에러: 비적합 AR 코드 라인: %s"
|
||||
msgstr "액션 리플레이 에러: 부적합 AR 코드 라인: %s"
|
||||
|
||||
#: Source/Core/Core/ActionReplay.cpp:742
|
||||
#, c-format
|
||||
|
@ -1221,7 +1221,7 @@ msgstr "클래식"
|
|||
#: Source/Core/DolphinWX/LogWindow.cpp:133
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:35
|
||||
msgid "Clear"
|
||||
msgstr "지우기"
|
||||
msgstr "지움"
|
||||
|
||||
#: Source/Core/Core/NetPlayServer.cpp:347
|
||||
msgid ""
|
||||
|
@ -1558,7 +1558,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"원본 종횡비에서 그림을 4:3이나 16:9로 자릅니다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 이것을 체크 해제해 두세요."
|
||||
"잘 모르겠으면, 이것을 체크 해제해 두세요."
|
||||
|
||||
#: Source/Core/Core/HW/WiimoteEmu/Attachment/Turntable.cpp:56
|
||||
msgid "Crossfade"
|
||||
|
@ -2154,7 +2154,7 @@ msgstr ""
|
|||
"비스듬한 보기 각도에 있는 텍스처들의 보이는 품질을 향상시킵니다.\n"
|
||||
"소수 게임에서 이슈들을 일으킬지도 모릅니다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 1x를 선택하세요."
|
||||
"잘 모르겠으면, 1x를 선택하세요."
|
||||
|
||||
#: Source/Core/DolphinWX/ISOProperties.cpp:333
|
||||
msgid ""
|
||||
|
@ -2926,9 +2926,7 @@ msgstr ""
|
|||
|
||||
#: Source/Core/Core/HW/GCMemcardDirectory.cpp:368
|
||||
msgid "GCMemcardDirectory: ClearBlock called with invalid block address"
|
||||
msgstr ""
|
||||
"GCMemcardDirector: 올바르지 않은 블록 주소로 인해 ClearBlock 이 호출되었습니"
|
||||
"다."
|
||||
msgstr "GCMemcardDirectory: 부적합한 블록 주소로 호출된 클리어블록"
|
||||
|
||||
#: Source/Core/VideoCommon/OpcodeDecoding.cpp:81
|
||||
#, c-format
|
||||
|
@ -3122,7 +3120,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"에뮬레이션 창 위에 마우스 커서가 있을 때 숨깁니다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 체크 해제해 두세요."
|
||||
"잘 모르겠으면, 체크 해제해 두세요."
|
||||
|
||||
#: Source/Core/DolphinWX/Config/AdvancedConfigPane.cpp:32
|
||||
msgid ""
|
||||
|
@ -3274,7 +3272,7 @@ msgstr ""
|
|||
"네거티브 효과 없는 많은 게임들에서 성능을 향상시킵니다. 소수 다른 게임들에서 "
|
||||
"그래픽 결함을 유발합니다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 체크해 두세요."
|
||||
"잘 모르겠으면, 체크해 두세요."
|
||||
|
||||
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:116
|
||||
msgid ""
|
||||
|
@ -3288,7 +3286,7 @@ msgstr ""
|
|||
"일부 게임들에서 성능을 향상시킵니다, 하지만 일부 게임플레이관련 특성들이나 그"
|
||||
"래픽 효과들이 비활성화 될지 모릅니다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 체크 해제해 두세요."
|
||||
"잘 모르겠으면, 체크 해제해 두세요."
|
||||
|
||||
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:114
|
||||
msgid ""
|
||||
|
@ -3308,7 +3306,7 @@ msgstr ""
|
|||
"니다, 이동을 덜 부드럽게 만들고 약간 성능을 감소시킵니다.\n"
|
||||
"Nvidia 3D Vision이 Direct3D 백엔드에서 작동하려면 배타적 모드가 필요합니다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 체크 해제해 두세요."
|
||||
"잘 모르겠으면, 체크 해제해 두세요."
|
||||
|
||||
#: Source/Core/DolphinWX/MemcardManager.cpp:812
|
||||
msgid "Import Save"
|
||||
|
@ -3459,7 +3457,7 @@ msgstr "소개화면"
|
|||
|
||||
#: Source/Core/DolphinWX/MemcardManager.cpp:467
|
||||
msgid "Invalid bat.map or dir entry."
|
||||
msgstr "비적합 bat.map 혹은 디렉토리 엔트리."
|
||||
msgstr "부적합 bat.map 혹은 디렉토리 엔트리."
|
||||
|
||||
#: Source/Core/Core/CoreTiming.cpp:496
|
||||
#, c-format
|
||||
|
@ -3547,7 +3545,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"게임 창을 다른 모든 창들의 맨위로 유지합니다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 이것을 체크 해제해 두세요."
|
||||
"잘 모르겠으면, 이것을 체크 해제해 두세요."
|
||||
|
||||
#: Source/Core/Core/HW/GCKeyboard.cpp:18
|
||||
#: Source/Core/DolphinWX/ControllerConfigDiag.cpp:51
|
||||
|
@ -3776,7 +3774,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"User/Load/Textures/<game_id>/ 로부터 커스텀 텍스처를 로드합니다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 체크 해제해 두세요."
|
||||
"잘 모르겠으면, 체크 해제해 두세요."
|
||||
|
||||
#: Source/Core/Core/HotkeyManager.cpp:112
|
||||
msgid "Load from selected slot"
|
||||
|
@ -3822,7 +3820,7 @@ msgstr ""
|
|||
"모든 프레임의 렌더 타임을 User/Logs/render_time.txt 에 로그합니다. 돌핀의 성"
|
||||
"능을 측정하고 싶을 때 이 기능을 사용하세요.\n"
|
||||
"\n"
|
||||
"모르겠으면, 체크 해제해 두세요."
|
||||
"잘 모르겠으면, 체크 해제해 두세요."
|
||||
|
||||
#: Source/Core/DolphinWX/LogConfigWindow.cpp:70
|
||||
msgid "Logger Outputs"
|
||||
|
@ -3880,7 +3878,7 @@ msgstr ""
|
|||
"안개 끄기는 적절한 안개 에뮬레이션과 관련된 일부 게임들을 망가뜨릴 것입니"
|
||||
"다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 이것을 체크 해제해 두세요."
|
||||
"잘 모르겠으면, 이것을 체크 해제해 두세요."
|
||||
|
||||
#: Source/Core/DolphinWX/ControllerConfigDiag.cpp:294
|
||||
#: Source/Core/DolphinWX/ControllerConfigDiag.cpp:297
|
||||
|
@ -3932,7 +3930,7 @@ msgstr "메모리 카드 파일 크기가 헤더 크기와 불일치합니다"
|
|||
#: Source/Core/Core/HW/GCMemcardRaw.cpp:184
|
||||
#, c-format
|
||||
msgid "MemoryCard: ClearBlock called on invalid address (0x%x)"
|
||||
msgstr "메모리카드: 부적합 주소 (0x%x) 상에서 호출된 클리어블럭"
|
||||
msgstr "메모리카드: 부적합한 주소 (0x%x) 상에서 호출된 클리어블록"
|
||||
|
||||
#: Source/Core/Core/HW/GCMemcardRaw.cpp:154
|
||||
#, c-format
|
||||
|
@ -3984,7 +3982,7 @@ msgstr ""
|
|||
"인코딩되고 있는 포맷을 보여주기 위해 텍스처들을 수정합니다. 대개의 경우 에뮬"
|
||||
"레이션 리셋이 요구됩니다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 이것을 체크 해제해 두세요."
|
||||
"잘 모르겠으면, 이것을 체크 해제해 두세요."
|
||||
|
||||
#: Source/Core/DolphinWX/ISOProperties.cpp:365
|
||||
msgid "Monoscopic Shadows"
|
||||
|
@ -4031,87 +4029,87 @@ msgstr "알림: 스트림 사이즈가 실제 데이터 길이와 매치되지
|
|||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:121
|
||||
msgid "NP Add"
|
||||
msgstr "NP 덧셈"
|
||||
msgstr "숫자패드 더하기"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:116
|
||||
msgid "NP Begin"
|
||||
msgstr "NP 시작"
|
||||
msgstr "숫자패드 시작"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:124
|
||||
msgid "NP Decimal"
|
||||
msgstr "NP 10진수"
|
||||
msgstr "숫자패드 소수점"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:118
|
||||
msgid "NP Delete"
|
||||
msgstr "NP 삭제"
|
||||
msgstr "숫자패드 삭제"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:125
|
||||
msgid "NP Divide"
|
||||
msgstr "NP 나누기"
|
||||
msgstr "숫자패드 나누기"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:112
|
||||
msgid "NP Down"
|
||||
msgstr "NP 아래"
|
||||
msgstr "숫자패드 아래"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:115
|
||||
msgid "NP End"
|
||||
msgstr "NP 끝"
|
||||
msgstr "숫자패드 끝"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:103
|
||||
msgid "NP Enter"
|
||||
msgstr "NP 엔터"
|
||||
msgstr "숫자패드 엔터"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:119
|
||||
msgid "NP Equal"
|
||||
msgstr "NP 같은"
|
||||
msgstr "숫자패드 등호"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:108
|
||||
msgid "NP Home"
|
||||
msgstr "NP 홈"
|
||||
msgstr "숫자패드 홈"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:117
|
||||
msgid "NP Insert"
|
||||
msgstr "NP 삽입"
|
||||
msgstr "숫자패드 삽입"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:109
|
||||
msgid "NP Left"
|
||||
msgstr "NP 왼쪽"
|
||||
msgstr "숫자패드 왼쪽"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:120
|
||||
msgid "NP Multiply"
|
||||
msgstr "NP 곱셈"
|
||||
msgstr "숫자패드 곱셈"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:114
|
||||
msgid "NP Page Down"
|
||||
msgstr "NP 페이지 다운"
|
||||
msgstr "숫자패드 페이지 다운"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:113
|
||||
msgid "NP Page Up"
|
||||
msgstr "NP 페이지 업"
|
||||
msgstr "숫자패드 페이지 업"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:111
|
||||
msgid "NP Right"
|
||||
msgstr "NP 오른쪽"
|
||||
msgstr "숫자패드 오른쪽"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:122
|
||||
msgid "NP Separator"
|
||||
msgstr "NP 분리기"
|
||||
msgstr "숫자패드 구분자"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:101
|
||||
msgid "NP Space"
|
||||
msgstr "NP 스페이스"
|
||||
msgstr "숫자패드 스페이스"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:123
|
||||
msgid "NP Subtract"
|
||||
msgstr "NP 뺄셈"
|
||||
msgstr "숫자패드 빼기"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:102
|
||||
msgid "NP Tab"
|
||||
msgstr "NP 탭"
|
||||
msgstr "숫자패드 탭"
|
||||
|
||||
#: Source/Core/DolphinWX/WXInputBase.cpp:110
|
||||
msgid "NP Up"
|
||||
msgstr "NP 위"
|
||||
msgstr "숫자패드 위"
|
||||
|
||||
#: Source/Core/DolphinWX/PatchAddEdit.cpp:57
|
||||
#: Source/Core/DolphinWX/ARCodeAddEdit.cpp:51
|
||||
|
@ -4640,7 +4638,7 @@ msgstr ""
|
|||
"히 더 로드가 요구됩니다, 하지만 최고 품질의 기하학 안티-앨리어싱을 제공하고 "
|
||||
"또한 빛, 그림자 효과, 텍스처 안티-앨리어싱을 적용합니다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 없음을 선택하세요."
|
||||
"잘 모르겠으면, 없음을 선택하세요."
|
||||
|
||||
#: Source/Core/DolphinWX/ControllerConfigDiag.cpp:256
|
||||
#: Source/Core/DolphinWX/InputConfigDiag.cpp:1005
|
||||
|
@ -4675,7 +4673,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"와이어프레임으로 장면을 렌더합니다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 이것을 체크 해제해 두세요."
|
||||
"잘 모르겠으면, 이것을 체크 해제해 두세요."
|
||||
|
||||
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:317
|
||||
msgid "Render to Main Window"
|
||||
|
@ -5010,7 +5008,7 @@ msgstr ""
|
|||
"강제 4:3: 표준 4:3 아날로그 TV를 흉내냅니다.\n"
|
||||
"창으로 늘림: 창 크기로 그림을 늘립니다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 자동을 선택하세요."
|
||||
"잘 모르겠으면, 자동을 선택하세요."
|
||||
|
||||
#: Source/Core/InputCommon/InputConfig.cpp:53
|
||||
msgid "Selected controller profile does not exist"
|
||||
|
@ -5028,7 +5026,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"사용할 하드웨어 어댑터를 선택하세요.\n"
|
||||
"\n"
|
||||
"모르겠으면, 처음 것을 사용하세요."
|
||||
"잘 모르겠으면, 처음 것을 사용하세요."
|
||||
|
||||
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:97
|
||||
msgid ""
|
||||
|
@ -5042,7 +5040,7 @@ msgstr ""
|
|||
"이것은 내부 해상도보다 크거나 같아야합니다. 성능 영향은 무시해도 될 정도입니"
|
||||
"다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 자동을 선택하세요."
|
||||
"잘 모르겠으면, 자동을 선택하세요."
|
||||
|
||||
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:140
|
||||
msgid ""
|
||||
|
@ -5060,7 +5058,7 @@ msgstr ""
|
|||
"여색 입체시는 빨강-청록색의 안경이 사용됩니다.\n"
|
||||
"심하게 에뮬레이션 스피드를 감소시키고 때로는 이슈를 유발합니다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 끄기를 선택하세요."
|
||||
"잘 모르겠으면, 끄기를 선택하세요."
|
||||
|
||||
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:94
|
||||
msgid ""
|
||||
|
@ -5074,7 +5072,7 @@ msgstr ""
|
|||
"소프트웨어 렌더러는 극히 느리고 디버깅에만 유용합니다, 그러니 사용할 이유가 "
|
||||
"없다면 OpenGL을 선택하는게 좋을 겁니다.\n"
|
||||
"\n"
|
||||
"모르겠으면, OpenGL을 선택하세요."
|
||||
"잘 모르겠으면, OpenGL을 선택하세요."
|
||||
|
||||
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:92
|
||||
msgid ""
|
||||
|
@ -5093,7 +5091,7 @@ msgstr ""
|
|||
"르게 행동할 것입니다, 그러니 최고의 에뮬레이션 경험을 위해서 둘다 시도해보기"
|
||||
"를 권장합니다 그리고나서 문제가 더 적게 있는 것을 고르세요.\n"
|
||||
"\n"
|
||||
"모르겠으면, OpenGL을 선택하세요."
|
||||
"잘 모르겠으면, OpenGL을 선택하세요."
|
||||
|
||||
#: Source/Core/DolphinWX/NetPlay/NetWindow.cpp:148
|
||||
msgid "Send"
|
||||
|
@ -5335,7 +5333,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"에뮬레이션 속도의 측정으로 초당 렌더되는 프레임 수치를 보여줍니다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 이것을 체크 해제해 두세요."
|
||||
"잘 모르겠으면, 이것을 체크 해제해 두세요."
|
||||
|
||||
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:124
|
||||
msgid ""
|
||||
|
@ -5345,7 +5343,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"다양한 렌더링 통계를 보여줍니다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 체크 해제해 두세요."
|
||||
"잘 모르겠으면, 체크 해제해 두세요."
|
||||
|
||||
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:431
|
||||
msgid "Side-by-Side"
|
||||
|
@ -5391,7 +5389,7 @@ msgstr ""
|
|||
"에뮬레이션 정확도를 만족시킴으로 EFB를 램에 복사를 조금 속도 향상시킵니다.\n"
|
||||
"어느 이슈를 겪고 있다면, 텍스처 캐시 정확도를 올려보거나 이 옵션을 끄세요.\n"
|
||||
"\n"
|
||||
"모르겠으면, 체크 해제해 두세요."
|
||||
"잘 모르겠으면, 체크 해제해 두세요."
|
||||
|
||||
#: Source/Core/DolphinWX/FrameTools.cpp:458
|
||||
#: Source/Core/DolphinWX/FrameTools.cpp:473
|
||||
|
@ -5424,7 +5422,8 @@ msgid ""
|
|||
msgstr ""
|
||||
"소프트웨어 렌더링은 다른 백엔드들 보다 상당히 느립니다.\n"
|
||||
"디버깅 목적으로만 유용합니다.\n"
|
||||
"소프트웨어 렌더링을 활성을 정말 원합니까? 모르겠으면, '아니오'를 선택하세요."
|
||||
"소프트웨어 렌더링을 활성을 정말 원합니까? 잘 모르겠으면, '아니오'를 선택하세"
|
||||
"요."
|
||||
|
||||
#: Source/Core/DolphinWX/Config/AudioConfigPane.cpp:58
|
||||
msgid "Sound Settings"
|
||||
|
@ -5477,7 +5476,7 @@ msgstr ""
|
|||
"입니다. 자동 (창 크기), 1.5x, 2.5x 는 일부 게임에서 이슈를 유발할지도 모릅니"
|
||||
"다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 원본을 선택하세요."
|
||||
"잘 모르겠으면, 원본을 선택하세요."
|
||||
|
||||
#: Source/Core/DolphinWX/Config/GeneralConfigPane.cpp:84
|
||||
msgid "Speed Limit:"
|
||||
|
@ -5568,7 +5567,7 @@ msgstr ""
|
|||
"활성 = EFB 복사를 텍스처에\n"
|
||||
"비활성 = EFB 복사를 램(과 텍스처)에\n"
|
||||
"\n"
|
||||
"모르겠으면, 체크해 두세요."
|
||||
"잘 모르겠으면, 체크해 두세요."
|
||||
|
||||
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:293
|
||||
msgid "Stretch to Window"
|
||||
|
@ -5614,7 +5613,7 @@ msgstr ""
|
|||
"왼쪽과 오른쪽 눈을 바꿉니다. 나란히 눈 교차로 보기를 원하면 대체로 유용합니"
|
||||
"다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 체크 해제해 두세요."
|
||||
"잘 모르겠으면, 체크 해제해 두세요."
|
||||
|
||||
#: Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp:270
|
||||
msgid "Swing"
|
||||
|
@ -5704,7 +5703,7 @@ msgstr ""
|
|||
"\"안전\" 설정은 GPU가 램으로부터 텍스처 업데이트를 놓칠 가능성을 없앱니다.\n"
|
||||
"더 낮은 정확도는 특정게임에서 인게임 텍스트가 왜곡되게 나타나게 합니다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 가장 오른쪽 값을 사용하세요."
|
||||
"잘 모르겠으면, 가장 오른쪽 값을 사용하세요."
|
||||
|
||||
#: Source/Core/Core/ConfigManager.cpp:802
|
||||
msgid "The WAD has been installed successfully"
|
||||
|
@ -5712,7 +5711,7 @@ msgstr "WAD가 성공적으로 설치되었습니다"
|
|||
|
||||
#: Source/Core/Core/ActionReplay.cpp:221
|
||||
msgid "The address is invalid"
|
||||
msgstr "주소가 부적합 합니다"
|
||||
msgstr "주소가 부적합합니다"
|
||||
|
||||
#: Source/Core/DolphinWX/MemcardManager.cpp:514
|
||||
msgid "The checksum was successfully fixed."
|
||||
|
@ -5827,7 +5826,7 @@ msgstr "기술된 \"%s\" 파일은 존재하지 않습니다"
|
|||
|
||||
#: Source/Core/Core/ActionReplay.cpp:224
|
||||
msgid "The value is invalid"
|
||||
msgstr "값이 부적합 합니다"
|
||||
msgstr "값이 부적합합니다"
|
||||
|
||||
#: Source/Core/DolphinWX/Config/InterfaceConfigPane.cpp:131
|
||||
msgid "Theme:"
|
||||
|
@ -5890,7 +5889,7 @@ msgstr ""
|
|||
"를 누르세요 (SHIFT+2 는 더 빠르게 SHIFT+1은 더 느리게 이동). 카메라를 리셋하"
|
||||
"려면 SHIFT+R을 스피드를 리셋하려면 SHIFT+F를 누르세요.\n"
|
||||
"\n"
|
||||
"모르겠으면, 체크 해제해 두세요."
|
||||
"잘 모르겠으면, 체크 해제해 두세요."
|
||||
|
||||
#: Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp:94
|
||||
#, c-format
|
||||
|
@ -6226,7 +6225,7 @@ msgstr ""
|
|||
"소수 게임들에서 이슈를 일으킵니다, 하지만 게임 및 GPU에 따라 괜찮은 속도 증가"
|
||||
"를 얻을 수 있습니다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 체크해 두세요."
|
||||
"잘 모르겠으면, 체크해 두세요."
|
||||
|
||||
#: Source/Core/DolphinWX/ISOProperties.cpp:366
|
||||
msgid "Use a single depth buffer for both eyes. Needed for a few games."
|
||||
|
@ -6310,7 +6309,7 @@ msgstr ""
|
|||
"갈라짐을 줄이기위해 수직 블랭크를 기다립니다. \n"
|
||||
"에뮬레이션 속도가 100% 이하라면 성능을 저하시킵니다.\n"
|
||||
"\n"
|
||||
"모르겠으면, 이것을 체크 해제해 두세요."
|
||||
"잘 모르겠으면, 이것을 체크 해제해 두세요."
|
||||
|
||||
#: Source/Core/Common/MsgHandler.cpp:63
|
||||
#: Source/Core/DolphinWX/MemcardManager.cpp:598
|
||||
|
|
|
@ -9,249 +9,249 @@
|
|||
|
||||
namespace ButtonManager
|
||||
{
|
||||
enum ButtonType
|
||||
{
|
||||
// GC
|
||||
BUTTON_A = 0,
|
||||
BUTTON_B = 1,
|
||||
BUTTON_START = 2,
|
||||
BUTTON_X = 3,
|
||||
BUTTON_Y = 4,
|
||||
BUTTON_Z = 5,
|
||||
BUTTON_UP = 6,
|
||||
BUTTON_DOWN = 7,
|
||||
BUTTON_LEFT = 8,
|
||||
BUTTON_RIGHT = 9,
|
||||
STICK_MAIN = 10, // Used on Java Side
|
||||
STICK_MAIN_UP = 11,
|
||||
STICK_MAIN_DOWN = 12,
|
||||
STICK_MAIN_LEFT = 13,
|
||||
STICK_MAIN_RIGHT = 14,
|
||||
STICK_C = 15, // Used on Java Side
|
||||
STICK_C_UP = 16,
|
||||
STICK_C_DOWN = 17,
|
||||
STICK_C_LEFT = 18,
|
||||
STICK_C_RIGHT = 19,
|
||||
TRIGGER_L = 20,
|
||||
TRIGGER_R = 21,
|
||||
// Wiimote
|
||||
WIIMOTE_BUTTON_A = 100,
|
||||
WIIMOTE_BUTTON_B = 101,
|
||||
WIIMOTE_BUTTON_MINUS = 102,
|
||||
WIIMOTE_BUTTON_PLUS = 103,
|
||||
WIIMOTE_BUTTON_HOME = 104,
|
||||
WIIMOTE_BUTTON_1 = 105,
|
||||
WIIMOTE_BUTTON_2 = 106,
|
||||
WIIMOTE_UP = 107,
|
||||
WIIMOTE_DOWN = 108,
|
||||
WIIMOTE_LEFT = 109,
|
||||
WIIMOTE_RIGHT = 110,
|
||||
WIIMOTE_IR = 111, // To Be Used on Java Side
|
||||
WIIMOTE_IR_UP = 112,
|
||||
WIIMOTE_IR_DOWN = 113,
|
||||
WIIMOTE_IR_LEFT = 114,
|
||||
WIIMOTE_IR_RIGHT = 115,
|
||||
WIIMOTE_IR_FORWARD = 116,
|
||||
WIIMOTE_IR_BACKWARD = 117,
|
||||
WIIMOTE_IR_HIDE = 118,
|
||||
WIIMOTE_SWING = 119, // To Be Used on Java Side
|
||||
WIIMOTE_SWING_UP = 120,
|
||||
WIIMOTE_SWING_DOWN = 121,
|
||||
WIIMOTE_SWING_LEFT = 122,
|
||||
WIIMOTE_SWING_RIGHT = 123,
|
||||
WIIMOTE_SWING_FORWARD = 124,
|
||||
WIIMOTE_SWING_BACKWARD = 125,
|
||||
WIIMOTE_TILT = 126, // To Be Used on Java Side
|
||||
WIIMOTE_TILT_FORWARD = 127,
|
||||
WIIMOTE_TILT_BACKWARD = 128,
|
||||
WIIMOTE_TILT_LEFT = 129,
|
||||
WIIMOTE_TILT_RIGHT = 130,
|
||||
WIIMOTE_TILT_MODIFIER = 131,
|
||||
WIIMOTE_SHAKE_X = 132,
|
||||
WIIMOTE_SHAKE_Y = 133,
|
||||
WIIMOTE_SHAKE_Z = 134,
|
||||
//Nunchuk
|
||||
NUNCHUK_BUTTON_C = 200,
|
||||
NUNCHUK_BUTTON_Z = 201,
|
||||
NUNCHUK_STICK = 202, // To Be Used on Java Side
|
||||
NUNCHUK_STICK_UP = 203,
|
||||
NUNCHUK_STICK_DOWN = 204,
|
||||
NUNCHUK_STICK_LEFT = 205,
|
||||
NUNCHUK_STICK_RIGHT = 206,
|
||||
NUNCHUK_SWING = 207, // To Be Used on Java Side
|
||||
NUNCHUK_SWING_UP = 208,
|
||||
NUNCHUK_SWING_DOWN = 209,
|
||||
NUNCHUK_SWING_LEFT = 210,
|
||||
NUNCHUK_SWING_RIGHT = 211,
|
||||
NUNCHUK_SWING_FORWARD = 212,
|
||||
NUNCHUK_SWING_BACKWARD = 213,
|
||||
NUNCHUK_TILT = 214, // To Be Used on Java Side
|
||||
NUNCHUK_TILT_FORWARD = 215,
|
||||
NUNCHUK_TILT_BACKWARD = 216,
|
||||
NUNCHUK_TILT_LEFT = 217,
|
||||
NUNCHUK_TILT_RIGHT = 218,
|
||||
NUNCHUK_TILT_MODIFIER = 219,
|
||||
NUNCHUK_SHAKE_X = 220,
|
||||
NUNCHUK_SHAKE_Y = 221,
|
||||
NUNCHUK_SHAKE_Z = 222,
|
||||
//Classic
|
||||
CLASSIC_BUTTON_A = 300,
|
||||
CLASSIC_BUTTON_B = 301,
|
||||
CLASSIC_BUTTON_X = 302,
|
||||
CLASSIC_BUTTON_Y = 303,
|
||||
CLASSIC_BUTTON_MINUS = 304,
|
||||
CLASSIC_BUTTON_PLUS = 305,
|
||||
CLASSIC_BUTTON_HOME = 306,
|
||||
CLASSIC_BUTTON_ZL = 307,
|
||||
CLASSIC_BUTTON_ZR = 308,
|
||||
CLASSIC_DPAD_UP = 309,
|
||||
CLASSIC_DPAD_DOWN = 310,
|
||||
CLASSIC_DPAD_LEFT = 311,
|
||||
CLASSIC_DPAD_RIGHT = 312,
|
||||
CLASSIC_STICK_LEFT = 313, // To Be Used on Java Side
|
||||
CLASSIC_STICK_LEFT_UP = 314,
|
||||
CLASSIC_STICK_LEFT_DOWN = 315,
|
||||
CLASSIC_STICK_LEFT_LEFT = 316,
|
||||
CLASSIC_STICK_LEFT_RIGHT = 317,
|
||||
CLASSIC_STICK_RIGHT = 318, // To Be Used on Java Side
|
||||
CLASSIC_STICK_RIGHT_UP = 319,
|
||||
CLASSIC_STICK_RIGHT_DOWN = 320,
|
||||
CLASSIC_STICK_RIGHT_LEFT = 321,
|
||||
CLASSIC_STICK_RIGHT_RIGHT = 322,
|
||||
CLASSIC_TRIGGER_L = 323,
|
||||
CLASSIC_TRIGGER_R = 324,
|
||||
//Guitar
|
||||
GUITAR_BUTTON_MINUS = 400,
|
||||
GUITAR_BUTTON_PLUS = 401,
|
||||
GUITAR_FRET_GREEN = 402,
|
||||
GUITAR_FRET_RED = 403,
|
||||
GUITAR_FRET_YELLOW = 404,
|
||||
GUITAR_FRET_BLUE = 405,
|
||||
GUITAR_FRET_ORANGE = 406,
|
||||
GUITAR_STRUM_UP = 407,
|
||||
GUITAR_STRUM_DOWN = 408,
|
||||
GUITAR_STICK = 409, // To Be Used on Java Side
|
||||
GUITAR_STICK_UP = 410,
|
||||
GUITAR_STICK_DOWN = 411,
|
||||
GUITAR_STICK_LEFT = 412,
|
||||
GUITAR_STICK_RIGHT = 413,
|
||||
GUITAR_WHAMMY_BAR = 414,
|
||||
//Drums
|
||||
DRUMS_BUTTON_MINUS = 500,
|
||||
DRUMS_BUTTON_PLUS = 501,
|
||||
DRUMS_PAD_RED = 502,
|
||||
DRUMS_PAD_YELLOW = 503,
|
||||
DRUMS_PAD_BLUE = 504,
|
||||
DRUMS_PAD_GREEN = 505,
|
||||
DRUMS_PAD_ORANGE = 506,
|
||||
DRUMS_PAD_BASS = 507,
|
||||
DRUMS_STICK = 508, // To Be Used on Java Side
|
||||
DRUMS_STICK_UP = 509,
|
||||
DRUMS_STICK_DOWN = 510,
|
||||
DRUMS_STICK_LEFT = 511,
|
||||
DRUMS_STICK_RIGHT = 512,
|
||||
//Turntable
|
||||
TURNTABLE_BUTTON_GREEN_LEFT = 600,
|
||||
TURNTABLE_BUTTON_RED_LEFT = 601,
|
||||
TURNTABLE_BUTTON_BLUE_LEFT = 602,
|
||||
TURNTABLE_BUTTON_GREEN_RIGHT = 603,
|
||||
TURNTABLE_BUTTON_RED_RIGHT = 604,
|
||||
TURNTABLE_BUTTON_BLUE_RIGHT = 605,
|
||||
TURNTABLE_BUTTON_MINUS = 606,
|
||||
TURNTABLE_BUTTON_PLUS = 607,
|
||||
TURNTABLE_BUTTON_HOME = 608,
|
||||
TURNTABLE_BUTTON_EUPHORIA = 609,
|
||||
TURNTABLE_TABLE_LEFT = 610, // To Be Used on Java Side
|
||||
TURNTABLE_TABLE_LEFT_LEFT = 611,
|
||||
TURNTABLE_TABLE_LEFT_RIGHT = 612,
|
||||
TURNTABLE_TABLE_RIGHT = 613, // To Be Used on Java Side
|
||||
TURNTABLE_TABLE_RIGHT_LEFT = 614,
|
||||
TURNTABLE_TABLE_RIGHT_RIGHT = 615,
|
||||
TURNTABLE_STICK = 616, // To Be Used on Java Side
|
||||
TURNTABLE_STICK_UP = 617,
|
||||
TURNTABLE_STICK_DOWN = 618,
|
||||
TURNTABLE_STICK_LEFT = 619,
|
||||
TURNTABLE_STICK_RIGHT = 620,
|
||||
TURNTABLE_EFFECT_DIAL = 621,
|
||||
TURNTABLE_CROSSFADE = 622, // To Be Used on Java Side
|
||||
TURNTABLE_CROSSFADE_LEFT = 623,
|
||||
TURNTABLE_CROSSFADE_RIGHT = 624,
|
||||
};
|
||||
enum ButtonState
|
||||
{
|
||||
BUTTON_RELEASED = 0,
|
||||
BUTTON_PRESSED = 1
|
||||
};
|
||||
enum BindType
|
||||
{
|
||||
BIND_BUTTON = 0,
|
||||
BIND_AXIS
|
||||
};
|
||||
class Button
|
||||
{
|
||||
private:
|
||||
ButtonState m_state;
|
||||
public:
|
||||
Button() : m_state(BUTTON_RELEASED) {}
|
||||
void SetState(ButtonState state) { m_state = state; }
|
||||
bool Pressed() { return m_state == BUTTON_PRESSED; }
|
||||
enum ButtonType
|
||||
{
|
||||
// GC
|
||||
BUTTON_A = 0,
|
||||
BUTTON_B = 1,
|
||||
BUTTON_START = 2,
|
||||
BUTTON_X = 3,
|
||||
BUTTON_Y = 4,
|
||||
BUTTON_Z = 5,
|
||||
BUTTON_UP = 6,
|
||||
BUTTON_DOWN = 7,
|
||||
BUTTON_LEFT = 8,
|
||||
BUTTON_RIGHT = 9,
|
||||
STICK_MAIN = 10, // Used on Java Side
|
||||
STICK_MAIN_UP = 11,
|
||||
STICK_MAIN_DOWN = 12,
|
||||
STICK_MAIN_LEFT = 13,
|
||||
STICK_MAIN_RIGHT = 14,
|
||||
STICK_C = 15, // Used on Java Side
|
||||
STICK_C_UP = 16,
|
||||
STICK_C_DOWN = 17,
|
||||
STICK_C_LEFT = 18,
|
||||
STICK_C_RIGHT = 19,
|
||||
TRIGGER_L = 20,
|
||||
TRIGGER_R = 21,
|
||||
// Wiimote
|
||||
WIIMOTE_BUTTON_A = 100,
|
||||
WIIMOTE_BUTTON_B = 101,
|
||||
WIIMOTE_BUTTON_MINUS = 102,
|
||||
WIIMOTE_BUTTON_PLUS = 103,
|
||||
WIIMOTE_BUTTON_HOME = 104,
|
||||
WIIMOTE_BUTTON_1 = 105,
|
||||
WIIMOTE_BUTTON_2 = 106,
|
||||
WIIMOTE_UP = 107,
|
||||
WIIMOTE_DOWN = 108,
|
||||
WIIMOTE_LEFT = 109,
|
||||
WIIMOTE_RIGHT = 110,
|
||||
WIIMOTE_IR = 111, // To Be Used on Java Side
|
||||
WIIMOTE_IR_UP = 112,
|
||||
WIIMOTE_IR_DOWN = 113,
|
||||
WIIMOTE_IR_LEFT = 114,
|
||||
WIIMOTE_IR_RIGHT = 115,
|
||||
WIIMOTE_IR_FORWARD = 116,
|
||||
WIIMOTE_IR_BACKWARD = 117,
|
||||
WIIMOTE_IR_HIDE = 118,
|
||||
WIIMOTE_SWING = 119, // To Be Used on Java Side
|
||||
WIIMOTE_SWING_UP = 120,
|
||||
WIIMOTE_SWING_DOWN = 121,
|
||||
WIIMOTE_SWING_LEFT = 122,
|
||||
WIIMOTE_SWING_RIGHT = 123,
|
||||
WIIMOTE_SWING_FORWARD = 124,
|
||||
WIIMOTE_SWING_BACKWARD = 125,
|
||||
WIIMOTE_TILT = 126, // To Be Used on Java Side
|
||||
WIIMOTE_TILT_FORWARD = 127,
|
||||
WIIMOTE_TILT_BACKWARD = 128,
|
||||
WIIMOTE_TILT_LEFT = 129,
|
||||
WIIMOTE_TILT_RIGHT = 130,
|
||||
WIIMOTE_TILT_MODIFIER = 131,
|
||||
WIIMOTE_SHAKE_X = 132,
|
||||
WIIMOTE_SHAKE_Y = 133,
|
||||
WIIMOTE_SHAKE_Z = 134,
|
||||
// Nunchuk
|
||||
NUNCHUK_BUTTON_C = 200,
|
||||
NUNCHUK_BUTTON_Z = 201,
|
||||
NUNCHUK_STICK = 202, // To Be Used on Java Side
|
||||
NUNCHUK_STICK_UP = 203,
|
||||
NUNCHUK_STICK_DOWN = 204,
|
||||
NUNCHUK_STICK_LEFT = 205,
|
||||
NUNCHUK_STICK_RIGHT = 206,
|
||||
NUNCHUK_SWING = 207, // To Be Used on Java Side
|
||||
NUNCHUK_SWING_UP = 208,
|
||||
NUNCHUK_SWING_DOWN = 209,
|
||||
NUNCHUK_SWING_LEFT = 210,
|
||||
NUNCHUK_SWING_RIGHT = 211,
|
||||
NUNCHUK_SWING_FORWARD = 212,
|
||||
NUNCHUK_SWING_BACKWARD = 213,
|
||||
NUNCHUK_TILT = 214, // To Be Used on Java Side
|
||||
NUNCHUK_TILT_FORWARD = 215,
|
||||
NUNCHUK_TILT_BACKWARD = 216,
|
||||
NUNCHUK_TILT_LEFT = 217,
|
||||
NUNCHUK_TILT_RIGHT = 218,
|
||||
NUNCHUK_TILT_MODIFIER = 219,
|
||||
NUNCHUK_SHAKE_X = 220,
|
||||
NUNCHUK_SHAKE_Y = 221,
|
||||
NUNCHUK_SHAKE_Z = 222,
|
||||
// Classic
|
||||
CLASSIC_BUTTON_A = 300,
|
||||
CLASSIC_BUTTON_B = 301,
|
||||
CLASSIC_BUTTON_X = 302,
|
||||
CLASSIC_BUTTON_Y = 303,
|
||||
CLASSIC_BUTTON_MINUS = 304,
|
||||
CLASSIC_BUTTON_PLUS = 305,
|
||||
CLASSIC_BUTTON_HOME = 306,
|
||||
CLASSIC_BUTTON_ZL = 307,
|
||||
CLASSIC_BUTTON_ZR = 308,
|
||||
CLASSIC_DPAD_UP = 309,
|
||||
CLASSIC_DPAD_DOWN = 310,
|
||||
CLASSIC_DPAD_LEFT = 311,
|
||||
CLASSIC_DPAD_RIGHT = 312,
|
||||
CLASSIC_STICK_LEFT = 313, // To Be Used on Java Side
|
||||
CLASSIC_STICK_LEFT_UP = 314,
|
||||
CLASSIC_STICK_LEFT_DOWN = 315,
|
||||
CLASSIC_STICK_LEFT_LEFT = 316,
|
||||
CLASSIC_STICK_LEFT_RIGHT = 317,
|
||||
CLASSIC_STICK_RIGHT = 318, // To Be Used on Java Side
|
||||
CLASSIC_STICK_RIGHT_UP = 319,
|
||||
CLASSIC_STICK_RIGHT_DOWN = 320,
|
||||
CLASSIC_STICK_RIGHT_LEFT = 321,
|
||||
CLASSIC_STICK_RIGHT_RIGHT = 322,
|
||||
CLASSIC_TRIGGER_L = 323,
|
||||
CLASSIC_TRIGGER_R = 324,
|
||||
// Guitar
|
||||
GUITAR_BUTTON_MINUS = 400,
|
||||
GUITAR_BUTTON_PLUS = 401,
|
||||
GUITAR_FRET_GREEN = 402,
|
||||
GUITAR_FRET_RED = 403,
|
||||
GUITAR_FRET_YELLOW = 404,
|
||||
GUITAR_FRET_BLUE = 405,
|
||||
GUITAR_FRET_ORANGE = 406,
|
||||
GUITAR_STRUM_UP = 407,
|
||||
GUITAR_STRUM_DOWN = 408,
|
||||
GUITAR_STICK = 409, // To Be Used on Java Side
|
||||
GUITAR_STICK_UP = 410,
|
||||
GUITAR_STICK_DOWN = 411,
|
||||
GUITAR_STICK_LEFT = 412,
|
||||
GUITAR_STICK_RIGHT = 413,
|
||||
GUITAR_WHAMMY_BAR = 414,
|
||||
// Drums
|
||||
DRUMS_BUTTON_MINUS = 500,
|
||||
DRUMS_BUTTON_PLUS = 501,
|
||||
DRUMS_PAD_RED = 502,
|
||||
DRUMS_PAD_YELLOW = 503,
|
||||
DRUMS_PAD_BLUE = 504,
|
||||
DRUMS_PAD_GREEN = 505,
|
||||
DRUMS_PAD_ORANGE = 506,
|
||||
DRUMS_PAD_BASS = 507,
|
||||
DRUMS_STICK = 508, // To Be Used on Java Side
|
||||
DRUMS_STICK_UP = 509,
|
||||
DRUMS_STICK_DOWN = 510,
|
||||
DRUMS_STICK_LEFT = 511,
|
||||
DRUMS_STICK_RIGHT = 512,
|
||||
// Turntable
|
||||
TURNTABLE_BUTTON_GREEN_LEFT = 600,
|
||||
TURNTABLE_BUTTON_RED_LEFT = 601,
|
||||
TURNTABLE_BUTTON_BLUE_LEFT = 602,
|
||||
TURNTABLE_BUTTON_GREEN_RIGHT = 603,
|
||||
TURNTABLE_BUTTON_RED_RIGHT = 604,
|
||||
TURNTABLE_BUTTON_BLUE_RIGHT = 605,
|
||||
TURNTABLE_BUTTON_MINUS = 606,
|
||||
TURNTABLE_BUTTON_PLUS = 607,
|
||||
TURNTABLE_BUTTON_HOME = 608,
|
||||
TURNTABLE_BUTTON_EUPHORIA = 609,
|
||||
TURNTABLE_TABLE_LEFT = 610, // To Be Used on Java Side
|
||||
TURNTABLE_TABLE_LEFT_LEFT = 611,
|
||||
TURNTABLE_TABLE_LEFT_RIGHT = 612,
|
||||
TURNTABLE_TABLE_RIGHT = 613, // To Be Used on Java Side
|
||||
TURNTABLE_TABLE_RIGHT_LEFT = 614,
|
||||
TURNTABLE_TABLE_RIGHT_RIGHT = 615,
|
||||
TURNTABLE_STICK = 616, // To Be Used on Java Side
|
||||
TURNTABLE_STICK_UP = 617,
|
||||
TURNTABLE_STICK_DOWN = 618,
|
||||
TURNTABLE_STICK_LEFT = 619,
|
||||
TURNTABLE_STICK_RIGHT = 620,
|
||||
TURNTABLE_EFFECT_DIAL = 621,
|
||||
TURNTABLE_CROSSFADE = 622, // To Be Used on Java Side
|
||||
TURNTABLE_CROSSFADE_LEFT = 623,
|
||||
TURNTABLE_CROSSFADE_RIGHT = 624,
|
||||
};
|
||||
enum ButtonState
|
||||
{
|
||||
BUTTON_RELEASED = 0,
|
||||
BUTTON_PRESSED = 1
|
||||
};
|
||||
enum BindType
|
||||
{
|
||||
BIND_BUTTON = 0,
|
||||
BIND_AXIS
|
||||
};
|
||||
class Button
|
||||
{
|
||||
private:
|
||||
ButtonState m_state;
|
||||
|
||||
~Button() {}
|
||||
};
|
||||
class Axis
|
||||
{
|
||||
private:
|
||||
float m_value;
|
||||
public:
|
||||
Axis() : m_value(0.0f) {}
|
||||
void SetValue(float value) { m_value = value; }
|
||||
float AxisValue() { return m_value; }
|
||||
public:
|
||||
Button() : m_state(BUTTON_RELEASED) {}
|
||||
void SetState(ButtonState state) { m_state = state; }
|
||||
bool Pressed() { return m_state == BUTTON_PRESSED; }
|
||||
~Button() {}
|
||||
};
|
||||
class Axis
|
||||
{
|
||||
private:
|
||||
float m_value;
|
||||
|
||||
~Axis() {}
|
||||
};
|
||||
public:
|
||||
Axis() : m_value(0.0f) {}
|
||||
void SetValue(float value) { m_value = value; }
|
||||
float AxisValue() { return m_value; }
|
||||
~Axis() {}
|
||||
};
|
||||
|
||||
struct sBind
|
||||
{
|
||||
const int _padID;
|
||||
const ButtonType _buttontype;
|
||||
const BindType _bindtype;
|
||||
const int _bind;
|
||||
const float _neg;
|
||||
sBind(int padID, ButtonType buttontype, BindType bindtype, int bind, float neg)
|
||||
: _padID(padID), _buttontype(buttontype), _bindtype(bindtype), _bind(bind), _neg(neg)
|
||||
{}
|
||||
};
|
||||
struct sBind
|
||||
{
|
||||
const int _padID;
|
||||
const ButtonType _buttontype;
|
||||
const BindType _bindtype;
|
||||
const int _bind;
|
||||
const float _neg;
|
||||
sBind(int padID, ButtonType buttontype, BindType bindtype, int bind, float neg)
|
||||
: _padID(padID), _buttontype(buttontype), _bindtype(bindtype), _bind(bind), _neg(neg)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class InputDevice
|
||||
{
|
||||
private:
|
||||
const std::string _dev;
|
||||
std::map<ButtonType, bool> _buttons;
|
||||
std::map<ButtonType, float> _axises;
|
||||
|
||||
class InputDevice
|
||||
{
|
||||
private:
|
||||
const std::string _dev;
|
||||
std::map<ButtonType, bool> _buttons;
|
||||
std::map<ButtonType, float> _axises;
|
||||
// Key is padID and ButtonType
|
||||
std::map<std::pair<int, ButtonType>, sBind*> _inputbinds;
|
||||
|
||||
// Key is padID and ButtonType
|
||||
std::map<std::pair<int, ButtonType>, sBind*> _inputbinds;
|
||||
public:
|
||||
InputDevice(std::string dev)
|
||||
: _dev(dev) {}
|
||||
~InputDevice()
|
||||
{
|
||||
for (const auto& bind : _inputbinds)
|
||||
delete bind.second;
|
||||
_inputbinds.clear();
|
||||
}
|
||||
void AddBind(sBind* bind) { _inputbinds[std::make_pair(bind->_padID, bind->_buttontype)] = bind; }
|
||||
bool PressEvent(int button, int action);
|
||||
void AxisEvent(int axis, float value);
|
||||
bool ButtonValue(int padID, ButtonType button);
|
||||
float AxisValue(int padID, ButtonType axis);
|
||||
};
|
||||
public:
|
||||
InputDevice(std::string dev) : _dev(dev) {}
|
||||
~InputDevice()
|
||||
{
|
||||
for (const auto& bind : _inputbinds)
|
||||
delete bind.second;
|
||||
_inputbinds.clear();
|
||||
}
|
||||
void AddBind(sBind* bind) { _inputbinds[std::make_pair(bind->_padID, bind->_buttontype)] = bind; }
|
||||
bool PressEvent(int button, int action);
|
||||
void AxisEvent(int axis, float value);
|
||||
bool ButtonValue(int padID, ButtonType button);
|
||||
float AxisValue(int padID, ButtonType axis);
|
||||
};
|
||||
|
||||
void Init();
|
||||
bool GetButtonPressed(int padID, ButtonType button);
|
||||
float GetAxisValue(int padID, ButtonType axis);
|
||||
bool GamepadEvent(const std::string& dev, int button, int action);
|
||||
void GamepadAxisEvent(const std::string& dev, int axis, float value);
|
||||
void Shutdown();
|
||||
void Init();
|
||||
bool GetButtonPressed(int padID, ButtonType button);
|
||||
float GetAxisValue(int padID, ButtonType axis);
|
||||
bool GamepadEvent(const std::string& dev, int button, int action);
|
||||
void GamepadAxisEvent(const std::string& dev, int axis, float value);
|
||||
void Shutdown();
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include <ao/ao.h>
|
||||
#endif
|
||||
|
||||
class AOSound final : public SoundStream
|
||||
class AOSound final: public SoundStream
|
||||
{
|
||||
#if defined(HAVE_AO) && HAVE_AO
|
||||
std::thread thread;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "AudioCommon/SoundStream.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
class AlsaSound final : public SoundStream
|
||||
class AlsaSound final: public SoundStream
|
||||
{
|
||||
#if defined(HAVE_ALSA) && HAVE_ALSA
|
||||
public:
|
||||
|
|
|
@ -14,16 +14,16 @@ extern SoundStream *g_sound_stream;
|
|||
|
||||
namespace AudioCommon
|
||||
{
|
||||
SoundStream* InitSoundStream(void *hWnd);
|
||||
void ShutdownSoundStream();
|
||||
std::vector<std::string> GetSoundBackends();
|
||||
void PauseAndLock(bool doLock, bool unpauseOnUnlock=true);
|
||||
void UpdateSoundStream();
|
||||
void ClearAudioBuffer(bool mute);
|
||||
void SendAIBuffer(short* samples, unsigned int num_samples);
|
||||
void StartAudioDump();
|
||||
void StopAudioDump();
|
||||
void IncreaseVolume(unsigned short offset);
|
||||
void DecreaseVolume(unsigned short offset);
|
||||
void ToggleMuteVolume();
|
||||
SoundStream* InitSoundStream(void *hWnd);
|
||||
void ShutdownSoundStream();
|
||||
std::vector<std::string> GetSoundBackends();
|
||||
void PauseAndLock(bool doLock, bool unpauseOnUnlock = true);
|
||||
void UpdateSoundStream();
|
||||
void ClearAudioBuffer(bool mute);
|
||||
void SendAIBuffer(short* samples, unsigned int num_samples);
|
||||
void StartAudioDump();
|
||||
void StopAudioDump();
|
||||
void IncreaseVolume(unsigned short offset);
|
||||
void DecreaseVolume(unsigned short offset);
|
||||
void ToggleMuteVolume();
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include "AudioCommon/SoundStream.h"
|
||||
|
||||
class CoreAudioSound final : public SoundStream
|
||||
class CoreAudioSound final: public SoundStream
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
public:
|
||||
|
|
|
@ -96,7 +96,7 @@ static T FIRFilter(const T *buf, int pos, int len, int count, const float *coeff
|
|||
*/
|
||||
static void Hamming(int n, float* w)
|
||||
{
|
||||
float k = float(2*M_PI/((float)(n - 1))); // 2*pi/(N-1)
|
||||
float k = float(2 * M_PI / ((float)(n - 1))); // 2*pi/(N-1)
|
||||
|
||||
// Calculate window coefficients
|
||||
for (int i = 0; i < n; i++)
|
||||
|
@ -163,13 +163,13 @@ static float* DesignFIR(unsigned int *n, float* fc, float opt)
|
|||
for (u32 i = 0; i < end; i++)
|
||||
{
|
||||
t1 = (float)(i + 1) - k2;
|
||||
w[end - i - 1] = w[*n - end + i] = float(w[end - i - 1] * sin(k1 * t1)/(M_PI * t1)); // Sinc
|
||||
g += 2*w[end - i - 1]; // Total gain in filter
|
||||
w[end - i - 1] = w[*n - end + i] = float(w[end - i - 1] * sin(k1 * t1) / (M_PI * t1)); // Sinc
|
||||
g += 2 * w[end - i - 1]; // Total gain in filter
|
||||
}
|
||||
|
||||
|
||||
// Normalize gain
|
||||
g = 1/g;
|
||||
g = 1 / g;
|
||||
for (u32 i = 0; i < *n; i++)
|
||||
w[i] *= g;
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ bool DSound::CreateBuffer()
|
|||
pcmwf.wBitsPerSample = 16;
|
||||
|
||||
// Fill out DSound buffer description.
|
||||
dsbdesc.dwSize = sizeof(DSBUFFERDESC);
|
||||
dsbdesc.dwSize = sizeof(DSBUFFERDESC);
|
||||
dsbdesc.dwFlags = DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_CTRLVOLUME | DSBCAPS_GLOBALFOCUS;
|
||||
dsbdesc.dwBufferBytes = bufferSize = SOUND_FRAME_SIZE * SOUND_SAMPLES_STEREO * (SConfig::GetInstance().iLatency + SOUND_BUFFER_COUNT) * sizeof(s16);
|
||||
dsbdesc.lpwfxFormat = (WAVEFORMATEX *)&pcmwf;
|
||||
|
@ -49,8 +49,8 @@ bool DSound::CreateBuffer()
|
|||
}
|
||||
|
||||
bool DSound::WriteDataToBuffer(DWORD dwOffset, // Our own write cursor.
|
||||
char* soundData, // Start of our data.
|
||||
DWORD dwSoundBytes) // Size of block to copy.
|
||||
char* soundData, // Start of our data.
|
||||
DWORD dwSoundBytes) // Size of block to copy.
|
||||
{
|
||||
// I want to record the regular audio to, how do I do that?
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include <dsound.h>
|
||||
#endif
|
||||
|
||||
class DSound final : public SoundStream
|
||||
class DSound final: public SoundStream
|
||||
{
|
||||
#ifdef _WIN32
|
||||
void *hWnd;
|
||||
|
@ -54,13 +54,17 @@ public:
|
|||
, hWnd(_hWnd)
|
||||
{}
|
||||
|
||||
virtual ~DSound() {}
|
||||
virtual ~DSound()
|
||||
{}
|
||||
|
||||
virtual bool Start() override;
|
||||
virtual void SetVolume(int volume) override;
|
||||
virtual void Stop() override;
|
||||
virtual void Clear(bool mute) override;
|
||||
static bool isValid() { return true; }
|
||||
static bool isValid()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#else
|
||||
public:
|
||||
|
|
|
@ -207,15 +207,17 @@ void CMixer::MixerFifo::PushSamples(const s16* samples, u32 num_samples)
|
|||
void CMixer::PushSamples(const s16 *samples, u32 num_samples)
|
||||
{
|
||||
m_dma_mixer.PushSamples(samples, num_samples);
|
||||
int sample_rate = m_dma_mixer.GetInputSampleRate();
|
||||
if (m_log_dsp_audio)
|
||||
g_wave_writer_dsp.AddStereoSamplesBE(samples, num_samples);
|
||||
g_wave_writer_dsp.AddStereoSamplesBE(samples, num_samples, sample_rate);
|
||||
}
|
||||
|
||||
void CMixer::PushStreamingSamples(const s16 *samples, u32 num_samples)
|
||||
{
|
||||
m_streaming_mixer.PushSamples(samples, num_samples);
|
||||
int sample_rate = m_streaming_mixer.GetInputSampleRate();
|
||||
if (m_log_dtk_audio)
|
||||
g_wave_writer_dtk.AddStereoSamplesBE(samples, num_samples);
|
||||
g_wave_writer_dtk.AddStereoSamplesBE(samples, num_samples, sample_rate);
|
||||
}
|
||||
|
||||
void CMixer::PushWiimoteSpeakerSamples(const s16 *samples, u32 num_samples, u32 sample_rate)
|
||||
|
@ -278,7 +280,7 @@ void CMixer::StartLogDTKAudio(const std::string& filename)
|
|||
if (!m_log_dtk_audio)
|
||||
{
|
||||
m_log_dtk_audio = true;
|
||||
g_wave_writer_dtk.Start(filename, 48000);
|
||||
g_wave_writer_dtk.Start(filename, m_streaming_mixer.GetInputSampleRate());
|
||||
g_wave_writer_dtk.SetSkipSilence(false);
|
||||
NOTICE_LOG(AUDIO, "Starting DTK Audio logging");
|
||||
}
|
||||
|
@ -307,7 +309,7 @@ void CMixer::StartLogDSPAudio(const std::string& filename)
|
|||
if (!m_log_dsp_audio)
|
||||
{
|
||||
m_log_dsp_audio = true;
|
||||
g_wave_writer_dsp.Start(filename, 32000);
|
||||
g_wave_writer_dsp.Start(filename, m_dma_mixer.GetInputSampleRate());
|
||||
g_wave_writer_dsp.SetSkipSilence(false);
|
||||
NOTICE_LOG(AUDIO, "Starting DSP Audio logging");
|
||||
}
|
||||
|
@ -329,4 +331,9 @@ void CMixer::StopLogDSPAudio()
|
|||
{
|
||||
WARN_LOG(AUDIO, "DSP Audio logging has already been stopped");
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int CMixer::MixerFifo::GetInputSampleRate() const
|
||||
{
|
||||
return m_input_sample_rate;
|
||||
}
|
|
@ -18,7 +18,8 @@ inline float Signed16ToFloat(const s16 s)
|
|||
return s * 0.000030517578125f;//(1.0f/32768.0f)
|
||||
}
|
||||
|
||||
class CMixer {
|
||||
class CMixer
|
||||
{
|
||||
|
||||
public:
|
||||
CMixer(u32 BackendSampleRate);
|
||||
|
@ -29,7 +30,8 @@ public:
|
|||
static const float CONTROL_FACTOR;
|
||||
static const float CONTROL_AVG;
|
||||
|
||||
virtual ~CMixer() {}
|
||||
virtual ~CMixer()
|
||||
{}
|
||||
|
||||
// Called from audio threads
|
||||
u32 Mix(s16* samples, u32 numSamples, bool consider_framelimit = true);
|
||||
|
@ -39,7 +41,10 @@ public:
|
|||
virtual void PushSamples(const s16* samples, u32 num_samples);
|
||||
virtual void PushStreamingSamples(const s16* samples, u32 num_samples);
|
||||
virtual void PushWiimoteSpeakerSamples(const s16* samples, u32 num_samples, u32 sample_rate);
|
||||
u32 GetSampleRate() const { return m_sample_rate; }
|
||||
u32 GetSampleRate() const
|
||||
{
|
||||
return m_sample_rate;
|
||||
}
|
||||
|
||||
void SetDMAInputSampleRate(u32 rate);
|
||||
void SetStreamInputSampleRate(u32 rate);
|
||||
|
@ -52,10 +57,19 @@ public:
|
|||
void StartLogDSPAudio(const std::string& filename);
|
||||
void StopLogDSPAudio();
|
||||
|
||||
std::mutex& MixerCritical() { return m_cs_mixing; }
|
||||
std::mutex& MixerCritical()
|
||||
{
|
||||
return m_cs_mixing;
|
||||
}
|
||||
|
||||
float GetCurrentSpeed() const { return m_speed.load(); }
|
||||
void UpdateSpeed(float val) { m_speed.store(val); }
|
||||
float GetCurrentSpeed() const
|
||||
{
|
||||
return m_speed.load();
|
||||
}
|
||||
void UpdateSpeed(float val)
|
||||
{
|
||||
m_speed.store(val);
|
||||
}
|
||||
|
||||
protected:
|
||||
class MixerFifo
|
||||
|
@ -79,6 +93,7 @@ protected:
|
|||
void PushSamples(const s16* samples, u32 num_samples);
|
||||
void Mix(float* samples, u32 numSamples, bool consider_framelimit = true);
|
||||
void SetInputSampleRate(u32 rate);
|
||||
unsigned int GetInputSampleRate() const;
|
||||
void SetVolume(u32 lvolume, u32 rvolume);
|
||||
void GetVolume(u32* lvolume, u32* rvolume) const;
|
||||
u32 AvailableSamples();
|
||||
|
@ -99,20 +114,28 @@ protected:
|
|||
float m_fraction;
|
||||
};
|
||||
|
||||
class LinearMixerFifo : public MixerFifo
|
||||
class LinearMixerFifo: public MixerFifo
|
||||
{
|
||||
public:
|
||||
LinearMixerFifo(CMixer* mixer, u32 sample_rate) : MixerFifo(mixer, sample_rate) {}
|
||||
LinearMixerFifo(CMixer* mixer, u32 sample_rate): MixerFifo(mixer, sample_rate)
|
||||
{}
|
||||
void Interpolate(u32 left_input_index, float* left_output, float* right_output) override;
|
||||
u32 GetWindowSize() override { return 4; };
|
||||
u32 GetWindowSize() override
|
||||
{
|
||||
return 4;
|
||||
};
|
||||
};
|
||||
|
||||
class CubicMixerFifo : public MixerFifo
|
||||
class CubicMixerFifo: public MixerFifo
|
||||
{
|
||||
public:
|
||||
CubicMixerFifo(CMixer* mixer, u32 sample_rate) : MixerFifo(mixer, sample_rate) {}
|
||||
CubicMixerFifo(CMixer* mixer, u32 sample_rate): MixerFifo(mixer, sample_rate)
|
||||
{}
|
||||
void Interpolate(u32 left_input_index, float* left_output, float* right_output) override;
|
||||
u32 GetWindowSize() override { return 8; };
|
||||
u32 GetWindowSize() override
|
||||
{
|
||||
return 8;
|
||||
};
|
||||
};
|
||||
|
||||
CubicMixerFifo m_dma_mixer;
|
||||
|
|
|
@ -12,13 +12,12 @@
|
|||
|
||||
bool NullSound::Start()
|
||||
{
|
||||
m_enablesoundloop = false;
|
||||
m_enablesoundloop = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void NullSound::SetVolume(int volume)
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
void NullSound::Update()
|
||||
{
|
||||
|
@ -38,5 +37,4 @@ void NullSound::Clear(bool mute)
|
|||
}
|
||||
|
||||
void NullSound::Stop()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
|
|
@ -7,19 +7,23 @@
|
|||
#include <array>
|
||||
#include "AudioCommon/SoundStream.h"
|
||||
|
||||
class NullSound final : public SoundStream
|
||||
class NullSound final: public SoundStream
|
||||
{
|
||||
public:
|
||||
NullSound()
|
||||
{}
|
||||
|
||||
virtual ~NullSound() {}
|
||||
virtual ~NullSound()
|
||||
{}
|
||||
|
||||
virtual bool Start() override;
|
||||
virtual void SetVolume(int volume) override;
|
||||
virtual void Stop() override;
|
||||
virtual void Clear(bool mute) override;
|
||||
static bool isValid() { return true; }
|
||||
static bool isValid()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
virtual void Update() override;
|
||||
private:
|
||||
static constexpr size_t BUFFER_SIZE = 48000 * 4 / 32;
|
||||
|
|
|
@ -55,7 +55,7 @@ bool OpenALStream::Start()
|
|||
}
|
||||
|
||||
// Initialize DPL2 parameters
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -117,10 +117,10 @@ void OpenALStream::InitializeSoundLoop()
|
|||
// Set the default sound volume as saved in the config file.
|
||||
alSourcef(uiSource, AL_GAIN, fVolume);
|
||||
s16* temp = new s16[SOUND_FRAME_SIZE * samplesize];
|
||||
memset(temp, 0, SOUND_FRAME_SIZE * samplesize* sizeof(u16));
|
||||
memset(temp, 0, SOUND_FRAME_SIZE * samplesize * sizeof(u16));
|
||||
for (u8 i = 0; i < numBuffers; i++)
|
||||
{
|
||||
alBufferData(uiBuffers[i], format, temp, SOUND_FRAME_SIZE * samplesize* sizeof(u16), ulFrequency);
|
||||
alBufferData(uiBuffers[i], format, temp, SOUND_FRAME_SIZE * samplesize * sizeof(u16), ulFrequency);
|
||||
}
|
||||
delete[] temp;
|
||||
alSourceQueueBuffers(uiSource, numBuffers, uiBuffers);
|
||||
|
@ -157,7 +157,7 @@ bool OpenALStream::SupportSurroundOutput()
|
|||
{
|
||||
bool surround_capable = SConfig::GetInstance().bDPL2Decoder;
|
||||
#if defined(__APPLE__)
|
||||
surround_capable = false;
|
||||
surround_capable = false;
|
||||
#endif
|
||||
return surround_capable;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
class OpenALStream final : public SoundStream
|
||||
class OpenALStream final: public SoundStream
|
||||
{
|
||||
#if defined HAVE_OPENAL && HAVE_OPENAL
|
||||
protected:
|
||||
|
@ -33,13 +33,17 @@ public:
|
|||
: uiSource(0)
|
||||
{}
|
||||
|
||||
~OpenALStream() {}
|
||||
~OpenALStream()
|
||||
{}
|
||||
|
||||
virtual bool Start() override;
|
||||
virtual void SetVolume(int volume) override;
|
||||
virtual void Stop() override;
|
||||
virtual void Clear(bool mute) override;
|
||||
static bool isValid() { return true; }
|
||||
static bool isValid()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
ALuint uiBuffers[SOUND_BUFFER_COUNT + 32];
|
||||
|
|
|
@ -9,13 +9,16 @@
|
|||
#include "AudioCommon/SoundStream.h"
|
||||
#include "Common/Event.h"
|
||||
|
||||
class OpenSLESStream final : public SoundStream
|
||||
class OpenSLESStream final: public SoundStream
|
||||
{
|
||||
#ifdef ANDROID
|
||||
public:
|
||||
bool Start() override;
|
||||
void Stop() override;
|
||||
static bool isValid() { return true; }
|
||||
static bool isValid()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
std::thread thread;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Thread.h"
|
||||
|
||||
class PulseAudio final : public SoundStream
|
||||
class PulseAudio final: public SoundStream
|
||||
{
|
||||
#if defined(HAVE_PULSEAUDIO) && HAVE_PULSEAUDIO
|
||||
public:
|
||||
|
@ -24,7 +24,10 @@ public:
|
|||
void Stop() override;
|
||||
void Update() override;
|
||||
|
||||
static bool isValid() { return true; }
|
||||
static bool isValid()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void StateCallback(pa_context *c);
|
||||
void WriteCallback(pa_stream *s, size_t length);
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "Common/MathUtil.h"
|
||||
|
||||
SoundStream::SoundStream() : m_enablesoundloop(true), m_mixer(new CMixer(48000)), threadData(true), m_logAudio(false), m_muted(false)
|
||||
SoundStream::SoundStream(): m_enablesoundloop(true), m_mixer(new CMixer(48000)), threadData(true), m_logAudio(false), m_muted(false)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -35,25 +35,31 @@ SoundStream::~SoundStream()
|
|||
m_mixer.reset();
|
||||
}
|
||||
|
||||
void SoundStream::StartLogAudio(const char *filename) {
|
||||
if (!m_logAudio) {
|
||||
void SoundStream::StartLogAudio(const char *filename)
|
||||
{
|
||||
if (!m_logAudio)
|
||||
{
|
||||
m_logAudio = true;
|
||||
g_wave_writer.Start(filename, GetMixer()->GetSampleRate());
|
||||
g_wave_writer.SetSkipSilence(false);
|
||||
NOTICE_LOG(AUDIO, "Starting Audio logging");
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
WARN_LOG(AUDIO, "Audio logging already started");
|
||||
}
|
||||
}
|
||||
|
||||
void SoundStream::StopLogAudio() {
|
||||
if (m_logAudio) {
|
||||
void SoundStream::StopLogAudio()
|
||||
{
|
||||
if (m_logAudio)
|
||||
{
|
||||
m_logAudio = false;
|
||||
g_wave_writer.Stop();
|
||||
NOTICE_LOG(AUDIO, "Stopping Audio logging");
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
WARN_LOG(AUDIO, "Audio logging already stopped");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,22 +36,41 @@ protected:
|
|||
bool m_muted;
|
||||
std::unique_ptr<std::thread> thread;
|
||||
virtual void SoundLoop();
|
||||
virtual void InitializeSoundLoop() {}
|
||||
virtual u32 SamplesNeeded(){ return 0; }
|
||||
virtual void WriteSamples(s16 *src, u32 numsamples){}
|
||||
virtual bool SupportSurroundOutput(){ return false; };
|
||||
virtual void InitializeSoundLoop()
|
||||
{}
|
||||
virtual u32 SamplesNeeded()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
virtual void WriteSamples(s16 *src, u32 numsamples)
|
||||
{}
|
||||
virtual bool SupportSurroundOutput()
|
||||
{
|
||||
return false;
|
||||
};
|
||||
public:
|
||||
SoundStream();
|
||||
virtual ~SoundStream();
|
||||
|
||||
static bool isValid() { return false; }
|
||||
CMixer *GetMixer() const { return m_mixer.get(); }
|
||||
static bool isValid()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
CMixer *GetMixer() const
|
||||
{
|
||||
return m_mixer.get();
|
||||
}
|
||||
virtual bool Start();
|
||||
virtual void SetVolume(int) {}
|
||||
virtual void SetVolume(int)
|
||||
{}
|
||||
virtual void Stop();
|
||||
virtual void Clear(bool mute);
|
||||
virtual void Update() {};
|
||||
bool IsMuted() const { return m_muted; }
|
||||
virtual void Update()
|
||||
{};
|
||||
bool IsMuted() const
|
||||
{
|
||||
return m_muted;
|
||||
}
|
||||
void StartLogAudio(const char *filename);
|
||||
void StopLogAudio();
|
||||
};
|
||||
|
|
|
@ -12,8 +12,7 @@
|
|||
constexpr size_t WaveFileWriter::BUFFER_SIZE;
|
||||
|
||||
WaveFileWriter::WaveFileWriter()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
WaveFileWriter::~WaveFileWriter()
|
||||
{
|
||||
|
@ -25,19 +24,27 @@ bool WaveFileWriter::Start(const std::string& filename, unsigned int HLESampleRa
|
|||
// Check if the file is already open
|
||||
if (file)
|
||||
{
|
||||
PanicAlertT("The file %s was already open, the file header will not be written.", filename.c_str());
|
||||
PanicAlertT("The file %s was already open, the file header will not be written.",
|
||||
filename.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
file.Open(filename, "wb");
|
||||
if (!file)
|
||||
{
|
||||
PanicAlertT("The file %s could not be opened for writing. Please check if it's already opened by another program.", filename.c_str());
|
||||
PanicAlertT("The file %s could not be opened for writing. Please check if it's already opened "
|
||||
"by another program.",
|
||||
filename.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
audio_size = 0;
|
||||
|
||||
if (basename.empty())
|
||||
SplitPath(filename, nullptr, &basename, nullptr);
|
||||
|
||||
current_sample_rate = HLESampleRate;
|
||||
|
||||
// -----------------
|
||||
// Write file header
|
||||
// -----------------
|
||||
|
@ -46,12 +53,12 @@ bool WaveFileWriter::Start(const std::string& filename, unsigned int HLESampleRa
|
|||
Write4("WAVE");
|
||||
Write4("fmt ");
|
||||
|
||||
Write(16); // size of fmt block
|
||||
Write(0x00020001); //two channels, uncompressed
|
||||
Write(16); // size of fmt block
|
||||
Write(0x00020001); // two channels, uncompressed
|
||||
|
||||
const u32 sample_rate = HLESampleRate;
|
||||
Write(sample_rate);
|
||||
Write(sample_rate * 2 * 2); //two channels, 16bit
|
||||
Write(sample_rate * 2 * 2); // two channels, 16bit
|
||||
|
||||
Write(0x00100004);
|
||||
Write4("data");
|
||||
|
@ -81,12 +88,12 @@ void WaveFileWriter::Write(u32 value)
|
|||
file.WriteArray(&value, 1);
|
||||
}
|
||||
|
||||
void WaveFileWriter::Write4(const char *ptr)
|
||||
void WaveFileWriter::Write4(const char* ptr)
|
||||
{
|
||||
file.WriteBytes(ptr, 4);
|
||||
}
|
||||
|
||||
void WaveFileWriter::AddStereoSamples(const short *sample_data, u32 count)
|
||||
void WaveFileWriter::AddStereoSamples(const short* sample_data, u32 count, int sample_rate)
|
||||
{
|
||||
if (!file)
|
||||
PanicAlertT("WaveFileWriter - file not open.");
|
||||
|
@ -105,11 +112,13 @@ void WaveFileWriter::AddStereoSamples(const short *sample_data, u32 count)
|
|||
return;
|
||||
}
|
||||
|
||||
CheckSampleRate(sample_rate);
|
||||
|
||||
file.WriteBytes(sample_data, count * 4);
|
||||
audio_size += count * 4;
|
||||
}
|
||||
|
||||
void WaveFileWriter::AddStereoSamplesBE(const short *sample_data, u32 count)
|
||||
void WaveFileWriter::AddStereoSamplesBE(const short* sample_data, u32 count, int sample_rate)
|
||||
{
|
||||
if (!file)
|
||||
PanicAlertT("WaveFileWriter - file not open.");
|
||||
|
@ -133,11 +142,26 @@ void WaveFileWriter::AddStereoSamplesBE(const short *sample_data, u32 count)
|
|||
|
||||
for (u32 i = 0; i < count; i++)
|
||||
{
|
||||
//Flip the audio channels from RL to LR
|
||||
// Flip the audio channels from RL to LR
|
||||
conv_buffer[2 * i] = Common::swap16((u16)sample_data[2 * i + 1]);
|
||||
conv_buffer[2 * i + 1] = Common::swap16((u16)sample_data[2 * i]);
|
||||
}
|
||||
|
||||
CheckSampleRate(sample_rate);
|
||||
|
||||
file.WriteBytes(conv_buffer.data(), count * 4);
|
||||
audio_size += count * 4;
|
||||
}
|
||||
|
||||
void WaveFileWriter::CheckSampleRate(int sample_rate)
|
||||
{
|
||||
if (sample_rate != current_sample_rate)
|
||||
{
|
||||
Stop();
|
||||
file_index++;
|
||||
std::stringstream filename;
|
||||
filename << File::GetUserPath(D_DUMPAUDIO_IDX) << basename << file_index << ".wav";
|
||||
Start(filename.str(), sample_rate);
|
||||
current_sample_rate = sample_rate;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "Common/FileUtil.h"
|
||||
#include "Common/NonCopyable.h"
|
||||
|
||||
class WaveFileWriter : NonCopyable
|
||||
class WaveFileWriter: NonCopyable
|
||||
{
|
||||
public:
|
||||
WaveFileWriter();
|
||||
|
@ -29,12 +29,16 @@ public:
|
|||
bool Start(const std::string& filename, unsigned int HLESampleRate);
|
||||
void Stop();
|
||||
|
||||
void SetSkipSilence(bool skip) { skip_silence = skip; }
|
||||
|
||||
void AddStereoSamples(const short *sample_data, u32 count);
|
||||
void AddStereoSamplesBE(const short *sample_data, u32 count); // big endian
|
||||
u32 GetAudioSize() const { return audio_size; }
|
||||
|
||||
void SetSkipSilence(bool skip)
|
||||
{
|
||||
skip_silence = skip;
|
||||
}
|
||||
void AddStereoSamples(const short* sample_data, u32 count, int sample_rate);
|
||||
void AddStereoSamplesBE(const short* sample_data, u32 count, int sample_rate); // big endian
|
||||
u32 GetAudioSize() const
|
||||
{
|
||||
return audio_size;
|
||||
}
|
||||
private:
|
||||
static constexpr size_t BUFFER_SIZE = 32 * 1024;
|
||||
|
||||
|
@ -44,4 +48,8 @@ private:
|
|||
std::array<short, BUFFER_SIZE> conv_buffer{};
|
||||
void Write(u32 value);
|
||||
void Write4(const char* ptr);
|
||||
void CheckSampleRate(int sample_rate);
|
||||
std::string basename;
|
||||
int current_sample_rate;
|
||||
int file_index = 0;
|
||||
};
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "Common/MsgHandler.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
|
||||
struct StreamingVoiceContext : public IXAudio2VoiceCallback
|
||||
struct StreamingVoiceContext: public IXAudio2VoiceCallback
|
||||
{
|
||||
private:
|
||||
CMixer* const m_mixer;
|
||||
|
@ -39,12 +39,18 @@ public:
|
|||
void StreamingVoiceContext::WriteFrame(s16* src, u32 numsamples);
|
||||
bool StreamingVoiceContext::BufferReady();
|
||||
|
||||
STDMETHOD_(void, OnVoiceError) (THIS_ void* pBufferContext, HRESULT Error) {}
|
||||
STDMETHOD_(void, OnVoiceProcessingPassStart) (UINT32) {}
|
||||
STDMETHOD_(void, OnVoiceProcessingPassEnd) () {}
|
||||
STDMETHOD_(void, OnBufferStart) (void*) {}
|
||||
STDMETHOD_(void, OnLoopEnd) (void*) {}
|
||||
STDMETHOD_(void, OnStreamEnd) () {}
|
||||
STDMETHOD_(void, OnVoiceError) (THIS_ void* pBufferContext, HRESULT Error)
|
||||
{}
|
||||
STDMETHOD_(void, OnVoiceProcessingPassStart) (UINT32)
|
||||
{}
|
||||
STDMETHOD_(void, OnVoiceProcessingPassEnd) ()
|
||||
{}
|
||||
STDMETHOD_(void, OnBufferStart) (void*)
|
||||
{}
|
||||
STDMETHOD_(void, OnLoopEnd) (void*)
|
||||
{}
|
||||
STDMETHOD_(void, OnStreamEnd) ()
|
||||
{}
|
||||
|
||||
STDMETHOD_(void, OnBufferEnd) (void* context);
|
||||
};
|
||||
|
@ -82,20 +88,20 @@ StreamingVoiceContext::StreamingVoiceContext(IXAudio2 *pXAudio2, CMixer *pMixer,
|
|||
m_framesizeinbytes = m_useSurround ? SOUND_SURROUND_FRAME_SIZE_BYTES : (directstreaming ? BUFFER_SIZE_BYTES : SOUND_STEREO_FRAME_SIZE_BYTES);
|
||||
m_samplesizeinBytes = (m_useSurround ? SOUND_SAMPLES_SURROUND : SOUND_SAMPLES_STEREO) * sizeof(s16);
|
||||
m_xaudio_buffer.reset(new BYTE[m_buffercount * m_framesizeinbytes]);
|
||||
|
||||
|
||||
WAVEFORMATEXTENSIBLE wfx = {};
|
||||
|
||||
wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
|
||||
wfx.Format.nSamplesPerSec = m_mixer->GetSampleRate();
|
||||
|
||||
wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
|
||||
wfx.Format.nSamplesPerSec = m_mixer->GetSampleRate();
|
||||
wfx.Format.nChannels = m_useSurround ? 6 : 2;
|
||||
wfx.Format.wBitsPerSample = 16;
|
||||
wfx.Format.nBlockAlign = wfx.Format.nChannels*wfx.Format.wBitsPerSample / 8;
|
||||
wfx.Format.wBitsPerSample = 16;
|
||||
wfx.Format.nBlockAlign = wfx.Format.nChannels*wfx.Format.wBitsPerSample / 8;
|
||||
wfx.Format.nAvgBytesPerSec = wfx.Format.nSamplesPerSec * wfx.Format.nBlockAlign;
|
||||
wfx.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX);
|
||||
wfx.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX);
|
||||
wfx.Samples.wValidBitsPerSample = 16;
|
||||
wfx.dwChannelMask = m_useSurround ? (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT)
|
||||
: SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT;
|
||||
wfx.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
|
||||
wfx.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
|
||||
|
||||
// create source voice
|
||||
HRESULT hr;
|
||||
|
@ -278,7 +284,7 @@ void XAudio2::SetVolume(int volume)
|
|||
|
||||
void XAudio2::Update()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
void XAudio2::Clear(bool mute)
|
||||
|
|
|
@ -21,7 +21,7 @@ struct IXAudio2MasteringVoice;
|
|||
|
||||
#endif
|
||||
|
||||
class XAudio2 final : public SoundStream
|
||||
class XAudio2 final: public SoundStream
|
||||
{
|
||||
#ifdef _WIN32
|
||||
protected:
|
||||
|
@ -63,7 +63,10 @@ public:
|
|||
virtual void Clear(bool mute);
|
||||
virtual void SetVolume(int volume);
|
||||
|
||||
static bool isValid() { return InitLibrary(); }
|
||||
static bool isValid()
|
||||
{
|
||||
return InitLibrary();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include "Common/MsgHandler.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
|
||||
struct StreamingVoiceContext2_7 : public IXAudio2VoiceCallback
|
||||
struct StreamingVoiceContext2_7: public IXAudio2VoiceCallback
|
||||
{
|
||||
private:
|
||||
CMixer* const m_mixer;
|
||||
|
@ -41,12 +41,18 @@ public:
|
|||
void StreamingVoiceContext2_7::Play();
|
||||
void StreamingVoiceContext2_7::WriteFrame(s16* src, u32 numsamples);
|
||||
bool StreamingVoiceContext2_7::BufferReady();
|
||||
STDMETHOD_(void, OnVoiceError) (THIS_ void* pBufferContext, HRESULT Error) {}
|
||||
STDMETHOD_(void, OnVoiceProcessingPassStart) (UINT32) {}
|
||||
STDMETHOD_(void, OnVoiceProcessingPassEnd) () {}
|
||||
STDMETHOD_(void, OnBufferStart) (void*) {}
|
||||
STDMETHOD_(void, OnLoopEnd) (void*) {}
|
||||
STDMETHOD_(void, OnStreamEnd) () {}
|
||||
STDMETHOD_(void, OnVoiceError) (THIS_ void* pBufferContext, HRESULT Error)
|
||||
{}
|
||||
STDMETHOD_(void, OnVoiceProcessingPassStart) (UINT32)
|
||||
{}
|
||||
STDMETHOD_(void, OnVoiceProcessingPassEnd) ()
|
||||
{}
|
||||
STDMETHOD_(void, OnBufferStart) (void*)
|
||||
{}
|
||||
STDMETHOD_(void, OnLoopEnd) (void*)
|
||||
{}
|
||||
STDMETHOD_(void, OnStreamEnd) ()
|
||||
{}
|
||||
|
||||
STDMETHOD_(void, OnBufferEnd) (void* context);
|
||||
};
|
||||
|
@ -69,7 +75,7 @@ void StreamingVoiceContext2_7::SubmitBuffer(u32 index, u32 sizeinbytes)
|
|||
}
|
||||
|
||||
StreamingVoiceContext2_7::StreamingVoiceContext2_7(IXAudio2 *pXAudio2, CMixer *pMixer, bool useSurround, bool directstreaming)
|
||||
: m_mixer(pMixer),
|
||||
: m_mixer(pMixer),
|
||||
m_useSurround(useSurround),
|
||||
m_bufferReady(nullptr),
|
||||
m_bufferAddress(nullptr),
|
||||
|
@ -83,19 +89,19 @@ StreamingVoiceContext2_7::StreamingVoiceContext2_7(IXAudio2 *pXAudio2, CMixer *p
|
|||
m_framesizeinbytes = m_useSurround ? SOUND_SURROUND_FRAME_SIZE_BYTES : (directstreaming ? BUFFER_SIZE_BYTES : SOUND_STEREO_FRAME_SIZE_BYTES);
|
||||
m_samplesizeinBytes = (m_useSurround ? SOUND_SAMPLES_SURROUND : SOUND_SAMPLES_STEREO) * sizeof(s16);
|
||||
m_xaudio_buffer.reset(new BYTE[m_buffercount * m_framesizeinbytes]);
|
||||
|
||||
|
||||
WAVEFORMATEXTENSIBLE wfx = {};
|
||||
|
||||
wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
|
||||
wfx.Format.nSamplesPerSec = m_mixer->GetSampleRate();
|
||||
|
||||
wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
|
||||
wfx.Format.nSamplesPerSec = m_mixer->GetSampleRate();
|
||||
wfx.Format.nChannels = m_useSurround ? 6 : 2;
|
||||
wfx.Format.wBitsPerSample = 16;
|
||||
wfx.Format.nBlockAlign = wfx.Format.nChannels*wfx.Format.wBitsPerSample / 8;
|
||||
wfx.Format.wBitsPerSample = 16;
|
||||
wfx.Format.nBlockAlign = wfx.Format.nChannels*wfx.Format.wBitsPerSample / 8;
|
||||
wfx.Format.nAvgBytesPerSec = wfx.Format.nSamplesPerSec * wfx.Format.nBlockAlign;
|
||||
wfx.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX);
|
||||
wfx.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX);
|
||||
wfx.Samples.wValidBitsPerSample = 16;
|
||||
wfx.dwChannelMask = m_useSurround ? SPEAKER_5POINT1_SURROUND : SPEAKER_STEREO;
|
||||
wfx.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
|
||||
wfx.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
|
||||
|
||||
// create source voice
|
||||
HRESULT hr;
|
||||
|
@ -262,7 +268,7 @@ void XAudio2_7::SetVolume(int volume)
|
|||
|
||||
void XAudio2_7::Update()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
void XAudio2_7::Clear(bool mute)
|
||||
|
|
|
@ -27,7 +27,7 @@ struct IXAudio2MasteringVoice;
|
|||
|
||||
#endif
|
||||
|
||||
class XAudio2_7 final : public SoundStream
|
||||
class XAudio2_7 final: public SoundStream
|
||||
{
|
||||
#ifdef _WIN32
|
||||
protected:
|
||||
|
@ -71,7 +71,10 @@ public:
|
|||
virtual void Clear(bool mute);
|
||||
virtual void SetVolume(int volume);
|
||||
|
||||
static bool isValid() { return InitLibrary(); }
|
||||
static bool isValid()
|
||||
{
|
||||
return InitLibrary();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
|
|
|
@ -43,9 +43,9 @@
|
|||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Init call
|
||||
*/
|
||||
/*
|
||||
* Init call
|
||||
*/
|
||||
ALDeviceList::ALDeviceList()
|
||||
{
|
||||
ALDEVICEINFO ALDeviceInfo;
|
||||
|
@ -58,82 +58,82 @@ ALDeviceList::ALDeviceList()
|
|||
|
||||
// grab function pointers for 1.0-API functions, and if successful proceed to enumerate all devices
|
||||
//if (LoadOAL10Library(nullptr, &ALFunction) == TRUE) {
|
||||
if (alcIsExtensionPresent(nullptr, "ALC_ENUMERATION_EXT"))
|
||||
if (alcIsExtensionPresent(nullptr, "ALC_ENUMERATION_EXT"))
|
||||
{
|
||||
const char *devices = alcGetString(nullptr, ALC_DEVICE_SPECIFIER);
|
||||
const char *defaultDeviceName = alcGetString(nullptr, ALC_DEFAULT_DEVICE_SPECIFIER);
|
||||
// go through device list (each device terminated with a single nullptr, list terminated with double nullptr)
|
||||
for (s32 index = 0; devices != nullptr && strlen(devices) > 0; index++, devices += strlen(devices) + 1)
|
||||
{
|
||||
const char *devices = alcGetString(nullptr, ALC_DEVICE_SPECIFIER);
|
||||
const char *defaultDeviceName = alcGetString(nullptr, ALC_DEFAULT_DEVICE_SPECIFIER);
|
||||
// go through device list (each device terminated with a single nullptr, list terminated with double nullptr)
|
||||
for (s32 index = 0; devices != nullptr && strlen(devices) > 0; index++, devices += strlen(devices) + 1)
|
||||
if (strcmp(defaultDeviceName, devices) == 0)
|
||||
{
|
||||
if (strcmp(defaultDeviceName, devices) == 0)
|
||||
defaultDeviceIndex = index;
|
||||
}
|
||||
ALCdevice *device = alcOpenDevice(devices);
|
||||
if (device)
|
||||
{
|
||||
ALCcontext *context = alcCreateContext(device, nullptr);
|
||||
if (context)
|
||||
{
|
||||
defaultDeviceIndex = index;
|
||||
}
|
||||
ALCdevice *device = alcOpenDevice(devices);
|
||||
if (device)
|
||||
{
|
||||
ALCcontext *context = alcCreateContext(device, nullptr);
|
||||
if (context)
|
||||
alcMakeContextCurrent(context);
|
||||
// if new actual device name isn't already in the list, then add it...
|
||||
const char *actualDeviceName = alcGetString(device, ALC_DEVICE_SPECIFIER);
|
||||
bool bNewName = true;
|
||||
for (s32 i = 0; i < GetNumDevices(); i++)
|
||||
{
|
||||
alcMakeContextCurrent(context);
|
||||
// if new actual device name isn't already in the list, then add it...
|
||||
const char *actualDeviceName = alcGetString(device, ALC_DEVICE_SPECIFIER);
|
||||
bool bNewName = true;
|
||||
for (s32 i = 0; i < GetNumDevices(); i++)
|
||||
if (strcmp(GetDeviceName(i), actualDeviceName) == 0)
|
||||
{
|
||||
if (strcmp(GetDeviceName(i), actualDeviceName) == 0)
|
||||
{
|
||||
bNewName = false;
|
||||
}
|
||||
bNewName = false;
|
||||
}
|
||||
if ((bNewName) && (actualDeviceName != nullptr) && (strlen(actualDeviceName) > 0))
|
||||
{
|
||||
ALDeviceInfo.bSelected = true;
|
||||
ALDeviceInfo.strDeviceName = actualDeviceName;
|
||||
alcGetIntegerv(device, ALC_MAJOR_VERSION, sizeof(s32), &ALDeviceInfo.iMajorVersion);
|
||||
alcGetIntegerv(device, ALC_MINOR_VERSION, sizeof(s32), &ALDeviceInfo.iMinorVersion);
|
||||
|
||||
ALDeviceInfo.pvstrExtensions = new std::vector<std::string>;
|
||||
|
||||
// Check for ALC Extensions
|
||||
if (alcIsExtensionPresent(device, "ALC_EXT_CAPTURE") == AL_TRUE)
|
||||
ALDeviceInfo.pvstrExtensions->push_back("ALC_EXT_CAPTURE");
|
||||
if (alcIsExtensionPresent(device, "ALC_EXT_EFX") == AL_TRUE)
|
||||
ALDeviceInfo.pvstrExtensions->push_back("ALC_EXT_EFX");
|
||||
|
||||
// Check for AL Extensions
|
||||
if (alIsExtensionPresent("AL_EXT_OFFSET") == AL_TRUE)
|
||||
ALDeviceInfo.pvstrExtensions->push_back("AL_EXT_OFFSET");
|
||||
|
||||
if (alIsExtensionPresent("AL_EXT_LINEAR_DISTANCE") == AL_TRUE)
|
||||
ALDeviceInfo.pvstrExtensions->push_back("AL_EXT_LINEAR_DISTANCE");
|
||||
if (alIsExtensionPresent("AL_EXT_EXPONENT_DISTANCE") == AL_TRUE)
|
||||
ALDeviceInfo.pvstrExtensions->push_back("AL_EXT_EXPONENT_DISTANCE");
|
||||
|
||||
if (alIsExtensionPresent("EAX2.0") == AL_TRUE)
|
||||
ALDeviceInfo.pvstrExtensions->push_back("EAX2.0");
|
||||
if (alIsExtensionPresent("EAX3.0") == AL_TRUE)
|
||||
ALDeviceInfo.pvstrExtensions->push_back("EAX3.0");
|
||||
if (alIsExtensionPresent("EAX4.0") == AL_TRUE)
|
||||
ALDeviceInfo.pvstrExtensions->push_back("EAX4.0");
|
||||
if (alIsExtensionPresent("EAX5.0") == AL_TRUE)
|
||||
ALDeviceInfo.pvstrExtensions->push_back("EAX5.0");
|
||||
|
||||
if (alIsExtensionPresent("EAX-RAM") == AL_TRUE)
|
||||
ALDeviceInfo.pvstrExtensions->push_back("EAX-RAM");
|
||||
|
||||
// Get Source Count
|
||||
ALDeviceInfo.uiSourceCount = GetMaxNumSources();
|
||||
|
||||
vDeviceInfo.push_back(ALDeviceInfo);
|
||||
}
|
||||
alcMakeContextCurrent(nullptr);
|
||||
alcDestroyContext(context);
|
||||
}
|
||||
alcCloseDevice(device);
|
||||
if ((bNewName) && (actualDeviceName != nullptr) && (strlen(actualDeviceName) > 0))
|
||||
{
|
||||
ALDeviceInfo.bSelected = true;
|
||||
ALDeviceInfo.strDeviceName = actualDeviceName;
|
||||
alcGetIntegerv(device, ALC_MAJOR_VERSION, sizeof(s32), &ALDeviceInfo.iMajorVersion);
|
||||
alcGetIntegerv(device, ALC_MINOR_VERSION, sizeof(s32), &ALDeviceInfo.iMinorVersion);
|
||||
|
||||
ALDeviceInfo.pvstrExtensions = new std::vector<std::string>;
|
||||
|
||||
// Check for ALC Extensions
|
||||
if (alcIsExtensionPresent(device, "ALC_EXT_CAPTURE") == AL_TRUE)
|
||||
ALDeviceInfo.pvstrExtensions->push_back("ALC_EXT_CAPTURE");
|
||||
if (alcIsExtensionPresent(device, "ALC_EXT_EFX") == AL_TRUE)
|
||||
ALDeviceInfo.pvstrExtensions->push_back("ALC_EXT_EFX");
|
||||
|
||||
// Check for AL Extensions
|
||||
if (alIsExtensionPresent("AL_EXT_OFFSET") == AL_TRUE)
|
||||
ALDeviceInfo.pvstrExtensions->push_back("AL_EXT_OFFSET");
|
||||
|
||||
if (alIsExtensionPresent("AL_EXT_LINEAR_DISTANCE") == AL_TRUE)
|
||||
ALDeviceInfo.pvstrExtensions->push_back("AL_EXT_LINEAR_DISTANCE");
|
||||
if (alIsExtensionPresent("AL_EXT_EXPONENT_DISTANCE") == AL_TRUE)
|
||||
ALDeviceInfo.pvstrExtensions->push_back("AL_EXT_EXPONENT_DISTANCE");
|
||||
|
||||
if (alIsExtensionPresent("EAX2.0") == AL_TRUE)
|
||||
ALDeviceInfo.pvstrExtensions->push_back("EAX2.0");
|
||||
if (alIsExtensionPresent("EAX3.0") == AL_TRUE)
|
||||
ALDeviceInfo.pvstrExtensions->push_back("EAX3.0");
|
||||
if (alIsExtensionPresent("EAX4.0") == AL_TRUE)
|
||||
ALDeviceInfo.pvstrExtensions->push_back("EAX4.0");
|
||||
if (alIsExtensionPresent("EAX5.0") == AL_TRUE)
|
||||
ALDeviceInfo.pvstrExtensions->push_back("EAX5.0");
|
||||
|
||||
if (alIsExtensionPresent("EAX-RAM") == AL_TRUE)
|
||||
ALDeviceInfo.pvstrExtensions->push_back("EAX-RAM");
|
||||
|
||||
// Get Source Count
|
||||
ALDeviceInfo.uiSourceCount = GetMaxNumSources();
|
||||
|
||||
vDeviceInfo.push_back(ALDeviceInfo);
|
||||
}
|
||||
alcMakeContextCurrent(nullptr);
|
||||
alcDestroyContext(context);
|
||||
}
|
||||
alcCloseDevice(device);
|
||||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
ResetFilters();
|
||||
|
|
|
@ -21,7 +21,7 @@ constexpr u8 WIRE_FORMAT_VERSION = 0;
|
|||
|
||||
// Identifiers for the value types supported by the analytics reporting wire
|
||||
// format.
|
||||
enum class TypeId : u8
|
||||
enum class TypeId: u8
|
||||
{
|
||||
STRING = 0,
|
||||
BOOL = 1,
|
||||
|
@ -48,7 +48,7 @@ void AppendVarInt(std::string* out, u64 v)
|
|||
}
|
||||
|
||||
void AppendBytes(std::string* out, const u8* bytes, u32 length,
|
||||
bool encode_length = true)
|
||||
bool encode_length = true)
|
||||
{
|
||||
if (encode_length)
|
||||
{
|
||||
|
@ -76,34 +76,34 @@ AnalyticsReportBuilder::AnalyticsReportBuilder()
|
|||
}
|
||||
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report,
|
||||
const std::string& v)
|
||||
const std::string& v)
|
||||
{
|
||||
AppendType(report, TypeId::STRING);
|
||||
AppendBytes(report, reinterpret_cast<const u8*>(v.data()), static_cast<u32>(v.size()));
|
||||
}
|
||||
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report,
|
||||
const char* v)
|
||||
const char* v)
|
||||
{
|
||||
AppendSerializedValue(report, std::string(v));
|
||||
}
|
||||
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report,
|
||||
bool v)
|
||||
bool v)
|
||||
{
|
||||
AppendType(report, TypeId::BOOL);
|
||||
AppendBool(report, v);
|
||||
}
|
||||
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report,
|
||||
u64 v)
|
||||
u64 v)
|
||||
{
|
||||
AppendType(report, TypeId::UINT);
|
||||
AppendVarInt(report, v);
|
||||
}
|
||||
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report,
|
||||
s64 v)
|
||||
s64 v)
|
||||
{
|
||||
AppendType(report, TypeId::SINT);
|
||||
AppendBool(report, v >= 0);
|
||||
|
@ -111,22 +111,22 @@ void AnalyticsReportBuilder::AppendSerializedValue(std::string* report,
|
|||
}
|
||||
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report,
|
||||
u32 v)
|
||||
u32 v)
|
||||
{
|
||||
AppendSerializedValue(report, static_cast<u64>(v));
|
||||
}
|
||||
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report,
|
||||
s32 v)
|
||||
s32 v)
|
||||
{
|
||||
AppendSerializedValue(report, static_cast<s64>(v));
|
||||
}
|
||||
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report,
|
||||
float v)
|
||||
float v)
|
||||
{
|
||||
AppendType(report, TypeId::FLOAT);
|
||||
AppendBytes(report, reinterpret_cast<u8*>(&v), sizeof (v), false);
|
||||
AppendBytes(report, reinterpret_cast<u8*>(&v), sizeof(v), false);
|
||||
}
|
||||
|
||||
AnalyticsReporter::AnalyticsReporter()
|
||||
|
@ -190,7 +190,7 @@ void AnalyticsReporter::ThreadProc()
|
|||
void StdoutAnalyticsBackend::Send(std::string report)
|
||||
{
|
||||
printf("Analytics report sent:\n%s", HexDump(
|
||||
reinterpret_cast<const u8*>(report.data()), report.size()).c_str());
|
||||
reinterpret_cast<const u8*>(report.data()), report.size()).c_str());
|
||||
}
|
||||
|
||||
HttpAnalyticsBackend::HttpAnalyticsBackend(const std::string& endpoint)
|
||||
|
|
|
@ -47,7 +47,8 @@ namespace Common
|
|||
class AnalyticsReportingBackend
|
||||
{
|
||||
public:
|
||||
virtual ~AnalyticsReportingBackend() {}
|
||||
virtual ~AnalyticsReportingBackend()
|
||||
{}
|
||||
|
||||
// Called from the AnalyticsReporter backend thread.
|
||||
virtual void Send(std::string report) = 0;
|
||||
|
@ -146,16 +147,25 @@ public:
|
|||
// Gets the base report builder which is closed for each subsequent report
|
||||
// being sent. DO NOT use this builder to send a report. Only use it to add
|
||||
// new fields that should be globally available.
|
||||
AnalyticsReportBuilder& BaseBuilder() { return m_base_builder; }
|
||||
AnalyticsReportBuilder& BaseBuilder()
|
||||
{
|
||||
return m_base_builder;
|
||||
}
|
||||
|
||||
// Gets a cloned builder that can be used to send a report.
|
||||
AnalyticsReportBuilder Builder() const { return m_base_builder; }
|
||||
AnalyticsReportBuilder Builder() const
|
||||
{
|
||||
return m_base_builder;
|
||||
}
|
||||
|
||||
// Enqueues a report for sending. Consumes the report builder.
|
||||
void Send(AnalyticsReportBuilder&& report);
|
||||
|
||||
// For convenience.
|
||||
void Send(AnalyticsReportBuilder& report) { Send(std::move(report)); }
|
||||
void Send(AnalyticsReportBuilder& report)
|
||||
{
|
||||
Send(std::move(report));
|
||||
}
|
||||
|
||||
protected:
|
||||
void ThreadProc();
|
||||
|
@ -171,7 +181,7 @@ protected:
|
|||
|
||||
// Analytics backend to be used for debugging purpose, which dumps reports to
|
||||
// stdout.
|
||||
class StdoutAnalyticsBackend : public AnalyticsReportingBackend
|
||||
class StdoutAnalyticsBackend: public AnalyticsReportingBackend
|
||||
{
|
||||
public:
|
||||
void Send(std::string report) override;
|
||||
|
@ -179,7 +189,7 @@ public:
|
|||
|
||||
// Analytics backend that POSTs data to a remote HTTP(s) endpoint. WARNING:
|
||||
// remember to get explicit user consent before using.
|
||||
class HttpAnalyticsBackend : public AnalyticsReportingBackend
|
||||
class HttpAnalyticsBackend: public AnalyticsReportingBackend
|
||||
{
|
||||
public:
|
||||
HttpAnalyticsBackend(const std::string& endpoint);
|
||||
|
|
|
@ -74,20 +74,20 @@ inline T AtomicLoadAcquire(volatile T& src)
|
|||
template <typename T, typename U>
|
||||
inline void AtomicStore(volatile T& dest, U value)
|
||||
{
|
||||
dest = (T) value; // 32-bit writes are always atomic.
|
||||
dest = (T)value; // 32-bit writes are always atomic.
|
||||
}
|
||||
|
||||
template <typename T, typename U>
|
||||
inline void AtomicStoreRelease(volatile T& dest, U value)
|
||||
{
|
||||
_WriteBarrier(); // Compiler instruction only. x86 stores always have release semantics.
|
||||
dest = (T) value; // 32-bit writes are always atomic.
|
||||
dest = (T)value; // 32-bit writes are always atomic.
|
||||
}
|
||||
|
||||
template <typename T, typename U>
|
||||
inline T* AtomicExchangeAcquire(T* volatile& loc, U newval)
|
||||
{
|
||||
return (T*) _InterlockedExchangePointer_acq((void* volatile*) &loc, (void*) newval);
|
||||
return (T*)_InterlockedExchangePointer_acq((void* volatile*)&loc, (void*)newval);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -165,8 +165,8 @@ private:
|
|||
// former case to workaround compile errors which arise when using
|
||||
// std::underlying_type<T>::type directly.
|
||||
typedef typename std::conditional<std::is_enum<T>::value,
|
||||
std::underlying_type<T>,
|
||||
std::enable_if<true,T>>::type::type StorageType;
|
||||
std::underlying_type<T>,
|
||||
std::enable_if<true, T>>::type::type StorageType;
|
||||
|
||||
// Unsigned version of StorageType
|
||||
typedef typename std::make_unsigned<StorageType>::type StorageTypeU;
|
||||
|
|
|
@ -14,55 +14,78 @@
|
|||
#include <intrin.h>
|
||||
|
||||
template <typename T>
|
||||
static inline int CountSetBits(T v)
|
||||
constexpr int CountSetBits(T v)
|
||||
{
|
||||
// from https://graphics.stanford.edu/~seander/bithacks.html
|
||||
// GCC has this built in, but MSVC's intrinsic will only emit the actual
|
||||
// POPCNT instruction, which we're not depending on
|
||||
v = v - ((v >> 1) & (T)~(T)0/3);
|
||||
v = (v & (T)~(T)0/15*3) + ((v >> 2) & (T)~(T)0/15*3);
|
||||
v = (v + (v >> 4)) & (T)~(T)0/255*15;
|
||||
return (T)(v * ((T)~(T)0/255)) >> (sizeof(T) - 1) * 8;
|
||||
v = v - ((v >> 1) & (T)~(T)0 / 3);
|
||||
v = (v & (T)~(T)0 / 15 * 3) + ((v >> 2) & (T)~(T)0 / 15 * 3);
|
||||
v = (v + (v >> 4)) & (T)~(T)0 / 255 * 15;
|
||||
return (T)(v * ((T)~(T)0 / 255)) >> (sizeof(T) - 1) * 8;
|
||||
}
|
||||
static inline int LeastSignificantSetBit(u8 val)
|
||||
inline int LeastSignificantSetBit(u8 val)
|
||||
{
|
||||
unsigned long index;
|
||||
_BitScanForward(&index, val);
|
||||
return (int)index;
|
||||
}
|
||||
static inline int LeastSignificantSetBit(u16 val)
|
||||
inline int LeastSignificantSetBit(u16 val)
|
||||
{
|
||||
unsigned long index;
|
||||
_BitScanForward(&index, val);
|
||||
return (int)index;
|
||||
}
|
||||
static inline int LeastSignificantSetBit(u32 val)
|
||||
inline int LeastSignificantSetBit(u32 val)
|
||||
{
|
||||
unsigned long index;
|
||||
_BitScanForward(&index, val);
|
||||
return (int)index;
|
||||
}
|
||||
static inline int LeastSignificantSetBit(u64 val)
|
||||
inline int LeastSignificantSetBit(u64 val)
|
||||
{
|
||||
unsigned long index;
|
||||
_BitScanForward64(&index, val);
|
||||
return (int)index;
|
||||
}
|
||||
#else
|
||||
static inline int CountSetBits(u8 val) { return __builtin_popcount(val); }
|
||||
static inline int CountSetBits(u16 val) { return __builtin_popcount(val); }
|
||||
static inline int CountSetBits(u32 val) { return __builtin_popcount(val); }
|
||||
static inline int CountSetBits(u64 val) { return __builtin_popcountll(val); }
|
||||
static inline int LeastSignificantSetBit(u8 val) { return __builtin_ctz(val); }
|
||||
static inline int LeastSignificantSetBit(u16 val) { return __builtin_ctz(val); }
|
||||
static inline int LeastSignificantSetBit(u32 val) { return __builtin_ctz(val); }
|
||||
static inline int LeastSignificantSetBit(u64 val) { return __builtin_ctzll(val); }
|
||||
constexpr int CountSetBits(u8 val)
|
||||
{
|
||||
return __builtin_popcount(val);
|
||||
}
|
||||
constexpr int CountSetBits(u16 val)
|
||||
{
|
||||
return __builtin_popcount(val);
|
||||
}
|
||||
constexpr int CountSetBits(u32 val)
|
||||
{
|
||||
return __builtin_popcount(val);
|
||||
}
|
||||
constexpr int CountSetBits(u64 val)
|
||||
{
|
||||
return __builtin_popcountll(val);
|
||||
}
|
||||
inline int LeastSignificantSetBit(u8 val)
|
||||
{
|
||||
return __builtin_ctz(val);
|
||||
}
|
||||
inline int LeastSignificantSetBit(u16 val)
|
||||
{
|
||||
return __builtin_ctz(val);
|
||||
}
|
||||
inline int LeastSignificantSetBit(u32 val)
|
||||
{
|
||||
return __builtin_ctz(val);
|
||||
}
|
||||
inline int LeastSignificantSetBit(u64 val)
|
||||
{
|
||||
return __builtin_ctzll(val);
|
||||
}
|
||||
#endif
|
||||
|
||||
// namespace avoids conflict with OS X Carbon; don't use BitSet<T> directly
|
||||
namespace BS
|
||||
{
|
||||
|
||||
// Similar to std::bitset, this is a class which encapsulates a bitset, i.e.
|
||||
// using the set bits of an integer to represent a set of integers. Like that
|
||||
// class, it acts like an array of bools:
|
||||
|
@ -87,19 +110,26 @@ template <typename IntTy>
|
|||
class BitSet
|
||||
{
|
||||
static_assert(!std::is_signed<IntTy>::value, "BitSet should not be used with signed types");
|
||||
|
||||
public:
|
||||
// A reference to a particular bit, returned from operator[].
|
||||
class Ref
|
||||
{
|
||||
public:
|
||||
Ref(Ref&& other) : m_bs(other.m_bs), m_mask(other.m_mask) {}
|
||||
Ref(BitSet* bs, IntTy mask) : m_bs(bs), m_mask(mask) {}
|
||||
operator bool() const { return (m_bs->m_val & m_mask) != 0; }
|
||||
constexpr Ref(Ref&& other): m_bs(other.m_bs), m_mask(other.m_mask)
|
||||
{}
|
||||
constexpr Ref(BitSet* bs, IntTy mask) : m_bs(bs), m_mask(mask)
|
||||
{}
|
||||
constexpr operator bool() const
|
||||
{
|
||||
return (m_bs->m_val & m_mask) != 0;
|
||||
}
|
||||
bool operator=(bool set)
|
||||
{
|
||||
m_bs->m_val = (m_bs->m_val & ~m_mask) | (set ? m_mask : 0);
|
||||
return set;
|
||||
}
|
||||
|
||||
private:
|
||||
BitSet* m_bs;
|
||||
IntTy m_mask;
|
||||
|
@ -109,10 +139,15 @@ public:
|
|||
class Iterator
|
||||
{
|
||||
public:
|
||||
Iterator(const Iterator& other) : m_val(other.m_val), m_bit(other.m_bit) {}
|
||||
Iterator(IntTy val, int bit) : m_val(val), m_bit(bit) {}
|
||||
Iterator& operator=(Iterator other) { new (this) Iterator(other); return *this; }
|
||||
int operator*() { return m_bit; }
|
||||
constexpr Iterator(const Iterator& other): m_val(other.m_val), m_bit(other.m_bit)
|
||||
{}
|
||||
constexpr Iterator(IntTy val, int bit) : m_val(val), m_bit(bit)
|
||||
{}
|
||||
Iterator& operator=(Iterator other)
|
||||
{
|
||||
new (this) Iterator(other);
|
||||
return *this;
|
||||
}
|
||||
Iterator& operator++()
|
||||
{
|
||||
if (m_val == 0)
|
||||
|
@ -127,21 +162,33 @@ public:
|
|||
}
|
||||
return *this;
|
||||
}
|
||||
Iterator operator++(int _)
|
||||
Iterator operator++(int)
|
||||
{
|
||||
Iterator other(*this);
|
||||
++*this;
|
||||
return other;
|
||||
}
|
||||
bool operator==(Iterator other) const { return m_bit == other.m_bit; }
|
||||
bool operator!=(Iterator other) const { return m_bit != other.m_bit; }
|
||||
constexpr int operator*() const
|
||||
{
|
||||
return m_bit;
|
||||
}
|
||||
constexpr bool operator==(Iterator other) const
|
||||
{
|
||||
return m_bit == other.m_bit;
|
||||
}
|
||||
constexpr bool operator!=(Iterator other) const
|
||||
{
|
||||
return m_bit != other.m_bit;
|
||||
}
|
||||
private:
|
||||
IntTy m_val;
|
||||
int m_bit;
|
||||
};
|
||||
|
||||
BitSet() : m_val(0) {}
|
||||
explicit BitSet(IntTy val) : m_val(val) {}
|
||||
constexpr BitSet(): m_val(0)
|
||||
{}
|
||||
constexpr explicit BitSet(IntTy val): m_val(val)
|
||||
{}
|
||||
BitSet(std::initializer_list<int> init)
|
||||
{
|
||||
m_val = 0;
|
||||
|
@ -149,38 +196,85 @@ public:
|
|||
m_val |= (IntTy)1 << bit;
|
||||
}
|
||||
|
||||
static BitSet AllTrue(size_t count)
|
||||
constexpr static BitSet AllTrue(size_t count)
|
||||
{
|
||||
return BitSet(count == sizeof(IntTy)*8 ? ~(IntTy)0 : (((IntTy)1 << count) - 1));
|
||||
return BitSet(count == sizeof(IntTy) * 8 ? ~(IntTy)0 : (((IntTy)1 << count) - 1));
|
||||
}
|
||||
|
||||
Ref operator[](size_t bit) { return Ref(this, (IntTy)1 << bit); }
|
||||
const Ref operator[](size_t bit) const { return (*const_cast<BitSet*>(this))[bit]; }
|
||||
bool operator==(BitSet other) const { return m_val == other.m_val; }
|
||||
bool operator!=(BitSet other) const { return m_val != other.m_val; }
|
||||
bool operator<(BitSet other) const { return m_val < other.m_val; }
|
||||
bool operator>(BitSet other) const { return m_val > other.m_val; }
|
||||
BitSet operator|(BitSet other) const { return BitSet(m_val | other.m_val); }
|
||||
BitSet operator&(BitSet other) const { return BitSet(m_val & other.m_val); }
|
||||
BitSet operator^(BitSet other) const { return BitSet(m_val ^ other.m_val); }
|
||||
BitSet operator~() const { return BitSet(~m_val); }
|
||||
BitSet& operator|=(BitSet other) { return *this = *this | other; }
|
||||
BitSet& operator&=(BitSet other) { return *this = *this & other; }
|
||||
BitSet& operator^=(BitSet other) { return *this = *this ^ other; }
|
||||
explicit operator bool() const { return m_val != 0; }
|
||||
|
||||
Ref operator[](size_t bit)
|
||||
{
|
||||
return Ref(this, (IntTy)1 << bit);
|
||||
}
|
||||
constexpr const Ref operator[](size_t bit) const
|
||||
{
|
||||
return (*const_cast<BitSet*>(this))[bit];
|
||||
}
|
||||
constexpr bool operator==(BitSet other) const
|
||||
{
|
||||
return m_val == other.m_val;
|
||||
}
|
||||
constexpr bool operator!=(BitSet other) const
|
||||
{
|
||||
return m_val != other.m_val;
|
||||
}
|
||||
constexpr bool operator<(BitSet other) const
|
||||
{
|
||||
return m_val < other.m_val;
|
||||
}
|
||||
constexpr bool operator>(BitSet other) const
|
||||
{
|
||||
return m_val > other.m_val;
|
||||
}
|
||||
constexpr BitSet operator|(BitSet other) const
|
||||
{
|
||||
return BitSet(m_val | other.m_val);
|
||||
}
|
||||
constexpr BitSet operator&(BitSet other) const
|
||||
{
|
||||
return BitSet(m_val & other.m_val);
|
||||
}
|
||||
constexpr BitSet operator^(BitSet other) const
|
||||
{
|
||||
return BitSet(m_val ^ other.m_val);
|
||||
}
|
||||
constexpr BitSet operator~() const
|
||||
{
|
||||
return BitSet(~m_val);
|
||||
}
|
||||
constexpr explicit operator bool() const
|
||||
{
|
||||
return m_val != 0;
|
||||
}
|
||||
BitSet& operator|=(BitSet other)
|
||||
{
|
||||
return *this = *this | other;
|
||||
}
|
||||
BitSet& operator&=(BitSet other)
|
||||
{
|
||||
return *this = *this & other;
|
||||
}
|
||||
BitSet& operator^=(BitSet other)
|
||||
{
|
||||
return *this = *this ^ other;
|
||||
}
|
||||
// Warning: Even though on modern CPUs this is a single fast instruction,
|
||||
// Dolphin's official builds do not currently assume POPCNT support on x86,
|
||||
// so slower explicit bit twiddling is generated. Still should generally
|
||||
// be faster than a loop.
|
||||
unsigned int Count() const { return CountSetBits(m_val); }
|
||||
|
||||
Iterator begin() const { Iterator it(m_val, 0); return ++it; }
|
||||
Iterator end() const { return Iterator(m_val, -1); }
|
||||
|
||||
constexpr unsigned int Count() const
|
||||
{
|
||||
return CountSetBits(m_val);
|
||||
}
|
||||
constexpr Iterator begin() const
|
||||
{
|
||||
return ++Iterator(m_val, 0);
|
||||
}
|
||||
constexpr Iterator end() const
|
||||
{
|
||||
return Iterator(m_val, -1);
|
||||
}
|
||||
IntTy m_val;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
typedef BS::BitSet<u8> BitSet8;
|
||||
|
|
|
@ -105,51 +105,51 @@ public:
|
|||
|
||||
switch (m_running_state.load())
|
||||
{
|
||||
case STATE_NEED_EXECUTION:
|
||||
// We won't get notified while we are in the STATE_NEED_EXECUTION state, so maybe Wakeup was called.
|
||||
// So we have to assume on finishing the STATE_NEED_EXECUTION state, that there may be some remaining tasks.
|
||||
// To process this tasks, we call the payload again within the STATE_LAST_EXECUTION state.
|
||||
m_running_state--;
|
||||
case STATE_NEED_EXECUTION:
|
||||
// We won't get notified while we are in the STATE_NEED_EXECUTION state, so maybe Wakeup was called.
|
||||
// So we have to assume on finishing the STATE_NEED_EXECUTION state, that there may be some remaining tasks.
|
||||
// To process this tasks, we call the payload again within the STATE_LAST_EXECUTION state.
|
||||
m_running_state--;
|
||||
break;
|
||||
|
||||
case STATE_LAST_EXECUTION:
|
||||
// If we're still in the STATE_LAST_EXECUTION state, then Wakeup wasn't called within the last
|
||||
// execution of the payload. This means we should be ready now.
|
||||
// But bad luck, Wakeup may have been called right now. So break and rerun the payload
|
||||
// if the state was touched.
|
||||
if (m_running_state-- != STATE_LAST_EXECUTION)
|
||||
break;
|
||||
|
||||
case STATE_LAST_EXECUTION:
|
||||
// If we're still in the STATE_LAST_EXECUTION state, then Wakeup wasn't called within the last
|
||||
// execution of the payload. This means we should be ready now.
|
||||
// But bad luck, Wakeup may have been called right now. So break and rerun the payload
|
||||
// if the state was touched.
|
||||
if (m_running_state-- != STATE_LAST_EXECUTION)
|
||||
// Else we're likely in the STATE_DONE state now, so wakeup the waiting threads right now.
|
||||
// However, if we're not in the STATE_DONE state any more, the event should also be
|
||||
// triggered so that we'll skip the next waiting call quite fast.
|
||||
m_done_event.Set();
|
||||
|
||||
case STATE_DONE:
|
||||
// We're done now. So time to check if we want to sleep or if we want to stay in a busy loop.
|
||||
if (m_may_sleep.TestAndClear())
|
||||
{
|
||||
// Try to set the sleeping state.
|
||||
if (m_running_state-- != STATE_DONE)
|
||||
break;
|
||||
|
||||
// Else we're likely in the STATE_DONE state now, so wakeup the waiting threads right now.
|
||||
// However, if we're not in the STATE_DONE state any more, the event should also be
|
||||
// triggered so that we'll skip the next waiting call quite fast.
|
||||
m_done_event.Set();
|
||||
|
||||
case STATE_DONE:
|
||||
// We're done now. So time to check if we want to sleep or if we want to stay in a busy loop.
|
||||
if (m_may_sleep.TestAndClear())
|
||||
{
|
||||
// Try to set the sleeping state.
|
||||
if (m_running_state-- != STATE_DONE)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Busy loop.
|
||||
break;
|
||||
}
|
||||
|
||||
case STATE_SLEEPING:
|
||||
// Just relax
|
||||
if (timeout > 0)
|
||||
{
|
||||
m_new_work_event.WaitFor(std::chrono::milliseconds(timeout));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_new_work_event.Wait();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Busy loop.
|
||||
break;
|
||||
}
|
||||
|
||||
case STATE_SLEEPING:
|
||||
// Just relax
|
||||
if (timeout > 0)
|
||||
{
|
||||
m_new_work_event.WaitFor(std::chrono::milliseconds(timeout));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_new_work_event.Wait();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -205,7 +205,8 @@ private:
|
|||
Event m_new_work_event;
|
||||
Event m_done_event;
|
||||
|
||||
enum RUNNING_TYPE {
|
||||
enum RUNNING_TYPE
|
||||
{
|
||||
STATE_SLEEPING = 0,
|
||||
STATE_DONE = 1,
|
||||
STATE_LAST_EXECUTION = 2,
|
||||
|
|
|
@ -150,11 +150,11 @@ void MemChecks::AddFromStrings(const TMemChecksStr& mcstrs)
|
|||
std::stringstream ss;
|
||||
ss << std::hex << mcstr;
|
||||
ss >> mc.StartAddress;
|
||||
mc.bRange = mcstr.find("n") != mcstr.npos;
|
||||
mc.OnRead = mcstr.find("r") != mcstr.npos;
|
||||
mc.bRange = mcstr.find("n") != mcstr.npos;
|
||||
mc.OnRead = mcstr.find("r") != mcstr.npos;
|
||||
mc.OnWrite = mcstr.find("w") != mcstr.npos;
|
||||
mc.Log = mcstr.find("l") != mcstr.npos;
|
||||
mc.Break = mcstr.find("p") != mcstr.npos;
|
||||
mc.Log = mcstr.find("l") != mcstr.npos;
|
||||
mc.Break = mcstr.find("p") != mcstr.npos;
|
||||
if (mc.bRange)
|
||||
ss >> mc.EndAddress;
|
||||
else
|
||||
|
@ -215,9 +215,9 @@ bool TMemCheck::Action(DebugInterface* debug_interface, u32 iValue, u32 addr, bo
|
|||
{
|
||||
INFO_LOG(MEMMAP, "CHK %08x (%s) %s%i %0*x at %08x (%s)",
|
||||
pc, debug_interface->GetDescription(pc).c_str(),
|
||||
write ? "Write" : "Read", size*8, size*2, iValue, addr,
|
||||
write ? "Write" : "Read", size * 8, size * 2, iValue, addr,
|
||||
debug_interface->GetDescription(addr).c_str()
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -42,7 +42,7 @@ struct TMemCheck
|
|||
|
||||
// returns whether to break
|
||||
bool Action(DebugInterface* dbg_interface, u32 _iValue, u32 addr,
|
||||
bool write, int size, u32 pc);
|
||||
bool write, int size, u32 pc);
|
||||
};
|
||||
|
||||
struct TWatch
|
||||
|
@ -59,7 +59,10 @@ public:
|
|||
typedef std::vector<TBreakPoint> TBreakPoints;
|
||||
typedef std::vector<std::string> TBreakPointsStr;
|
||||
|
||||
const TBreakPoints& GetBreakPoints() { return m_BreakPoints; }
|
||||
const TBreakPoints& GetBreakPoints()
|
||||
{
|
||||
return m_BreakPoints;
|
||||
}
|
||||
|
||||
TBreakPointsStr GetStrings() const;
|
||||
void AddFromStrings(const TBreakPointsStr& bps);
|
||||
|
@ -91,7 +94,10 @@ public:
|
|||
|
||||
TMemChecks m_MemChecks;
|
||||
|
||||
const TMemChecks& GetMemChecks() { return m_MemChecks; }
|
||||
const TMemChecks& GetMemChecks()
|
||||
{
|
||||
return m_MemChecks;
|
||||
}
|
||||
|
||||
TMemChecksStr GetStrings() const;
|
||||
void AddFromStrings(const TMemChecksStr& mcs);
|
||||
|
@ -102,9 +108,15 @@ public:
|
|||
TMemCheck* GetMemCheck(u32 address);
|
||||
void Remove(u32 _Address);
|
||||
|
||||
void Clear() { m_MemChecks.clear(); }
|
||||
void Clear()
|
||||
{
|
||||
m_MemChecks.clear();
|
||||
}
|
||||
|
||||
bool HasAny() const { return !m_MemChecks.empty(); }
|
||||
bool HasAny() const
|
||||
{
|
||||
return !m_MemChecks.empty();
|
||||
}
|
||||
};
|
||||
|
||||
class Watches
|
||||
|
@ -113,7 +125,10 @@ public:
|
|||
typedef std::vector<TWatch> TWatches;
|
||||
typedef std::vector<std::string> TWatchesStr;
|
||||
|
||||
const TWatches& GetWatches() { return m_Watches; }
|
||||
const TWatches& GetWatches()
|
||||
{
|
||||
return m_Watches;
|
||||
}
|
||||
|
||||
TWatchesStr GetStrings() const;
|
||||
void AddFromStrings(const TWatchesStr& bps);
|
||||
|
|
|
@ -61,7 +61,9 @@ std::vector<std::string> cdio_get_devices()
|
|||
}
|
||||
|
||||
// advance to next drive
|
||||
while (*drive++) {}
|
||||
while (*drive++)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
return drives;
|
||||
|
@ -127,7 +129,8 @@ std::vector<std::string> cdio_get_devices()
|
|||
}
|
||||
CFRelease(str_bsd_path);
|
||||
IOObjectRelease(next_media);
|
||||
} while ((next_media = IOIteratorNext(media_iterator)) != 0);
|
||||
}
|
||||
while ((next_media = IOIteratorNext(media_iterator)) != 0);
|
||||
}
|
||||
IOObjectRelease(media_iterator);
|
||||
return drives;
|
||||
|
@ -140,7 +143,7 @@ static struct
|
|||
unsigned int num_min;
|
||||
unsigned int num_max;
|
||||
} checklist[] =
|
||||
{
|
||||
{
|
||||
#ifdef __linux__
|
||||
{ "/dev/cdrom", 0, 0 },
|
||||
{ "/dev/dvd", 0, 0 },
|
||||
|
@ -152,7 +155,7 @@ static struct
|
|||
{ "/dev/cd%d", 0, 27 },
|
||||
#endif
|
||||
{ nullptr, 0, 0 }
|
||||
};
|
||||
};
|
||||
|
||||
// Returns true if a device is a block or char device and not a symbolic link
|
||||
static bool is_device(const std::string& source_name)
|
||||
|
|
|
@ -29,7 +29,6 @@ set(SRCS Analytics.cpp
|
|||
TraversalClient.cpp
|
||||
Version.cpp
|
||||
x64ABI.cpp
|
||||
x64Analyzer.cpp
|
||||
x64Emitter.cpp
|
||||
Crypto/bn.cpp
|
||||
Crypto/ec.cpp
|
||||
|
|
|
@ -30,25 +30,25 @@ struct CPUInfo
|
|||
int num_cores = 0;
|
||||
int logical_cpu_count = 0;
|
||||
|
||||
bool bSSE = false;
|
||||
bool bSSE2 = false;
|
||||
bool bSSE3 = false;
|
||||
bool bSSSE3 = false;
|
||||
bool bSSE = false;
|
||||
bool bSSE2 = false;
|
||||
bool bSSE3 = false;
|
||||
bool bSSSE3 = false;
|
||||
bool bPOPCNT = false;
|
||||
bool bSSE4_1 = false;
|
||||
bool bSSE4_2 = false;
|
||||
bool bLZCNT = false;
|
||||
bool bSSE4A = false;
|
||||
bool bAVX = false;
|
||||
bool bAVX2 = false;
|
||||
bool bBMI1 = false;
|
||||
bool bBMI2 = false;
|
||||
bool bFMA = false;
|
||||
bool bFMA4 = false;
|
||||
bool bAES = false;
|
||||
bool bLZCNT = false;
|
||||
bool bSSE4A = false;
|
||||
bool bAVX = false;
|
||||
bool bAVX2 = false;
|
||||
bool bBMI1 = false;
|
||||
bool bBMI2 = false;
|
||||
bool bFMA = false;
|
||||
bool bFMA4 = false;
|
||||
bool bAES = false;
|
||||
// FXSAVE/FXRSTOR
|
||||
bool bFXSR = false;
|
||||
bool bMOVBE = false;
|
||||
bool bFXSR = false;
|
||||
bool bMOVBE = false;
|
||||
// This flag indicates that the hardware supports some mode
|
||||
// in which denormal inputs _and_ outputs are automatically set to (signed) zero.
|
||||
bool bFlushToZero = false;
|
||||
|
@ -57,11 +57,11 @@ struct CPUInfo
|
|||
bool bAtom = false;
|
||||
|
||||
// ARMv8 specific
|
||||
bool bFP = false;
|
||||
bool bFP = false;
|
||||
bool bASIMD = false;
|
||||
bool bCRC32 = false;
|
||||
bool bSHA1 = false;
|
||||
bool bSHA2 = false;
|
||||
bool bSHA1 = false;
|
||||
bool bSHA2 = false;
|
||||
|
||||
// Call Detect()
|
||||
explicit CPUInfo();
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
|
||||
|
||||
template <class T>
|
||||
struct LinkedListItem : public T
|
||||
struct LinkedListItem: public T
|
||||
{
|
||||
LinkedListItem<T> *next;
|
||||
};
|
||||
|
@ -66,10 +66,17 @@ public:
|
|||
Mode mode;
|
||||
|
||||
public:
|
||||
PointerWrap(u8 **ptr_, Mode mode_) : ptr(ptr_), mode(mode_) {}
|
||||
PointerWrap(u8 **ptr_, Mode mode_): ptr(ptr_), mode(mode_)
|
||||
{}
|
||||
|
||||
void SetMode(Mode mode_) { mode = mode_; }
|
||||
Mode GetMode() const { return mode; }
|
||||
void SetMode(Mode mode_)
|
||||
{
|
||||
mode = mode_;
|
||||
}
|
||||
Mode GetMode() const
|
||||
{
|
||||
return mode;
|
||||
}
|
||||
|
||||
template <typename K, class V>
|
||||
void Do(std::map<K, V>& x)
|
||||
|
@ -174,7 +181,7 @@ public:
|
|||
}
|
||||
|
||||
template <typename T, std::size_t N>
|
||||
void DoArray(T (&arr)[N])
|
||||
void DoArray(T(&arr)[N])
|
||||
{
|
||||
DoArray(arr, static_cast<u32>(N));
|
||||
}
|
||||
|
@ -240,8 +247,8 @@ public:
|
|||
}
|
||||
|
||||
// Let's pretend std::list doesn't exist!
|
||||
template <class T, LinkedListItem<T>* (*TNew)(), void (*TFree)(LinkedListItem<T>*), void (*TDo)(PointerWrap&, T*)>
|
||||
void DoLinkedList(LinkedListItem<T>*& list_start, LinkedListItem<T>** list_end=0)
|
||||
template <class T, LinkedListItem<T>* (*TNew)(), void(*TFree)(LinkedListItem<T>*), void(*TDo)(PointerWrap&, T*)>
|
||||
void DoLinkedList(LinkedListItem<T>*& list_start, LinkedListItem<T>** list_end = 0)
|
||||
{
|
||||
LinkedListItem<T>* list_cur = list_start;
|
||||
LinkedListItem<T>* prev = nullptr;
|
||||
|
@ -289,7 +296,8 @@ public:
|
|||
LinkedListItem<T>* next = list_cur->next;
|
||||
TFree(list_cur);
|
||||
list_cur = next;
|
||||
} while (list_cur);
|
||||
}
|
||||
while (list_cur);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -325,7 +333,7 @@ private:
|
|||
}
|
||||
|
||||
__forceinline
|
||||
void DoVoid(void* data, u32 size)
|
||||
void DoVoid(void* data, u32 size)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
|
@ -343,7 +351,7 @@ private:
|
|||
case MODE_VERIFY:
|
||||
_dbg_assert_msg_(COMMON, !memcmp(data, *ptr, size),
|
||||
"Savestate verification failure: buf %p != %p (size %u).\n",
|
||||
data, *ptr, size);
|
||||
data, *ptr, size);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// having to prefix them with gen-> or something similar.
|
||||
// Example implementation:
|
||||
// class JIT : public CodeBlock<ARMXEmitter> {}
|
||||
template<class T> class CodeBlock : public T, NonCopyable
|
||||
template<class T> class CodeBlock: public T, NonCopyable
|
||||
{
|
||||
private:
|
||||
// A privately used function to set the executable RAM space to something invalid.
|
||||
|
@ -32,11 +32,13 @@ protected:
|
|||
public:
|
||||
CodeBlock()
|
||||
: region(nullptr), region_size(0), parent_region_size(0),
|
||||
m_has_child(false), m_is_child(false), m_child(nullptr)
|
||||
{
|
||||
}
|
||||
m_has_child(false), m_is_child(false), m_child(nullptr)
|
||||
{}
|
||||
|
||||
virtual ~CodeBlock() { if (region) FreeCodeSpace(); }
|
||||
virtual ~CodeBlock()
|
||||
{
|
||||
if (region) FreeCodeSpace();
|
||||
}
|
||||
|
||||
// Call this before you generate any code.
|
||||
void AllocCodeSpace(int size, bool need_low = true)
|
||||
|
|
|
@ -48,7 +48,7 @@ static u32 Decode5A3(u16 val)
|
|||
return (a << 24) | (r << 16) | (g << 8) | b;
|
||||
}
|
||||
|
||||
void decode5A3image(u32* dst, u16* src, int width, int height)
|
||||
void decode5A3image(u32* dst, const u16* src, int width, int height)
|
||||
{
|
||||
for (int y = 0; y < height; y += 4)
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ void decode5A3image(u32* dst, u16* src, int width, int height)
|
|||
}
|
||||
}
|
||||
|
||||
void decodeCI8image(u32* dst, u8* src, u16* pal, int width, int height)
|
||||
void decodeCI8image(u32* dst, const u8* src, u16* pal, int width, int height)
|
||||
{
|
||||
for (int y = 0; y < height; y += 4)
|
||||
{
|
||||
|
@ -74,7 +74,7 @@ void decodeCI8image(u32* dst, u8* src, u16* pal, int width, int height)
|
|||
{
|
||||
for (int iy = 0; iy < 4; iy++, src += 8)
|
||||
{
|
||||
u32* tdst = dst+(y+iy)*width+x;
|
||||
u32* tdst = dst + (y + iy)*width + x;
|
||||
for (int ix = 0; ix < 8; ix++)
|
||||
{
|
||||
// huh, this seems wrong. CI8, not 5A3, no?
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
namespace ColorUtil
|
||||
{
|
||||
|
||||
void decode5A3image(u32* dst, u16* src, int width, int height);
|
||||
void decodeCI8image(u32* dst, u8* src, u16* pal, int width, int height);
|
||||
void decode5A3image(u32* dst, const u16* src, int width, int height);
|
||||
void decodeCI8image(u32* dst, const u8* src, u16* pal, int width, int height);
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -36,25 +36,31 @@ extern const std::string scm_distributor_str;
|
|||
#if defined _WIN32
|
||||
|
||||
// Memory leak checks
|
||||
#define CHECK_HEAP_INTEGRITY()
|
||||
#define CHECK_HEAP_INTEGRITY()
|
||||
|
||||
// Since they are always around on Windows
|
||||
#define HAVE_WX 1
|
||||
#define HAVE_OPENAL 1
|
||||
#define HAVE_WX 1
|
||||
#define HAVE_OPENAL 1
|
||||
|
||||
#define HAVE_PORTAUDIO 1
|
||||
#define HAVE_PORTAUDIO 1
|
||||
|
||||
// Debug definitions
|
||||
#if defined(_DEBUG)
|
||||
#include <crtdbg.h>
|
||||
#undef CHECK_HEAP_INTEGRITY
|
||||
#define CHECK_HEAP_INTEGRITY() {if (!_CrtCheckMemory()) PanicAlert("memory corruption detected. see log.");}
|
||||
// If you want to see how much a pain in the ass singletons are, for example:
|
||||
// {614} normal block at 0x030C5310, 188 bytes long.
|
||||
// Data: <Master Log > 4D 61 73 74 65 72 20 4C 6F 67 00 00 00 00 00 00
|
||||
struct CrtDebugBreak { CrtDebugBreak(int spot) { _CrtSetBreakAlloc(spot); } };
|
||||
//CrtDebugBreak breakAt(614);
|
||||
#endif // end DEBUG/FAST
|
||||
#if defined(_DEBUG)
|
||||
#include <crtdbg.h>
|
||||
#undef CHECK_HEAP_INTEGRITY
|
||||
#define CHECK_HEAP_INTEGRITY() {if (!_CrtCheckMemory()) PanicAlert("memory corruption detected. see log.");}
|
||||
// If you want to see how much a pain in the ass singletons are, for example:
|
||||
// {614} normal block at 0x030C5310, 188 bytes long.
|
||||
// Data: <Master Log > 4D 61 73 74 65 72 20 4C 6F 67 00 00 00 00 00 00
|
||||
struct CrtDebugBreak
|
||||
{
|
||||
CrtDebugBreak(int spot)
|
||||
{
|
||||
_CrtSetBreakAlloc(spot);
|
||||
}
|
||||
};
|
||||
//CrtDebugBreak breakAt(614);
|
||||
#endif // end DEBUG/FAST
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -134,7 +134,6 @@
|
|||
<ClInclude Include="TraversalClient.h" />
|
||||
<ClInclude Include="TraversalProto.h" />
|
||||
<ClInclude Include="x64ABI.h" />
|
||||
<ClInclude Include="x64Analyzer.h" />
|
||||
<ClInclude Include="x64Emitter.h" />
|
||||
<ClInclude Include="Crypto\bn.h" />
|
||||
<ClInclude Include="Crypto\ec.h" />
|
||||
|
@ -180,7 +179,6 @@
|
|||
<ClCompile Include="ucrtFreadWorkaround.cpp" />
|
||||
<ClCompile Include="Version.cpp" />
|
||||
<ClCompile Include="x64ABI.cpp" />
|
||||
<ClCompile Include="x64Analyzer.cpp" />
|
||||
<ClCompile Include="x64CPUDetect.cpp" />
|
||||
<ClCompile Include="x64Emitter.cpp" />
|
||||
<ClCompile Include="x64FPURoundMode.cpp" />
|
||||
|
|
|
@ -63,7 +63,6 @@
|
|||
<ClInclude Include="ThreadPool.h" />
|
||||
<ClInclude Include="Timer.h" />
|
||||
<ClInclude Include="x64ABI.h" />
|
||||
<ClInclude Include="x64Analyzer.h" />
|
||||
<ClInclude Include="x64Emitter.h" />
|
||||
<ClInclude Include="Logging\ConsoleListener.h">
|
||||
<Filter>Logging</Filter>
|
||||
|
@ -255,7 +254,6 @@
|
|||
<ClCompile Include="Timer.cpp" />
|
||||
<ClCompile Include="Version.cpp" />
|
||||
<ClCompile Include="x64ABI.cpp" />
|
||||
<ClCompile Include="x64Analyzer.cpp" />
|
||||
<ClCompile Include="x64CPUDetect.cpp" />
|
||||
<ClCompile Include="x64Emitter.cpp" />
|
||||
<ClCompile Include="x64FPURoundMode.cpp" />
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
// Will fail to compile on a non-array:
|
||||
template <typename T, size_t N>
|
||||
constexpr size_t ArraySize(T (&arr)[N])
|
||||
constexpr size_t ArraySize(T(&arr)[N])
|
||||
{
|
||||
return N;
|
||||
}
|
||||
|
@ -70,24 +70,24 @@ inline u64 _rotr64(u64 x, unsigned int shift)
|
|||
|
||||
#else // WIN32
|
||||
// Function Cross-Compatibility
|
||||
#define strcasecmp _stricmp
|
||||
#define strncasecmp _strnicmp
|
||||
#define unlink _unlink
|
||||
#define vscprintf _vscprintf
|
||||
#define strcasecmp _stricmp
|
||||
#define strncasecmp _strnicmp
|
||||
#define unlink _unlink
|
||||
#define vscprintf _vscprintf
|
||||
|
||||
// 64 bit offsets for Windows
|
||||
#define fseeko _fseeki64
|
||||
#define ftello _ftelli64
|
||||
#define atoll _atoi64
|
||||
#define stat64 _stat64
|
||||
#define fstat64 _fstat64
|
||||
#define fileno _fileno
|
||||
#define fseeko _fseeki64
|
||||
#define ftello _ftelli64
|
||||
#define atoll _atoi64
|
||||
#define stat64 _stat64
|
||||
#define fstat64 _fstat64
|
||||
#define fileno _fileno
|
||||
|
||||
extern "C"
|
||||
{
|
||||
__declspec(dllimport) void __stdcall DebugBreak(void);
|
||||
}
|
||||
#define Crash() {DebugBreak();}
|
||||
#define Crash() {DebugBreak();}
|
||||
#endif // WIN32 ndef
|
||||
|
||||
// Generic function to get last error message.
|
||||
|
@ -98,8 +98,14 @@ std::string GetLastErrorMsg();
|
|||
|
||||
namespace Common
|
||||
{
|
||||
inline u8 swap8(u8 _data) {return _data;}
|
||||
inline u32 swap24(const u8* _data) {return (_data[0] << 16) | (_data[1] << 8) | _data[2];}
|
||||
inline u8 swap8(u8 _data)
|
||||
{
|
||||
return _data;
|
||||
}
|
||||
inline u32 swap24(const u8* _data)
|
||||
{
|
||||
return (_data[0] << 16) | (_data[1] << 8) | _data[2];
|
||||
}
|
||||
|
||||
#ifdef ANDROID
|
||||
#undef swap16
|
||||
|
@ -108,36 +114,87 @@ inline u32 swap24(const u8* _data) {return (_data[0] << 16) | (_data[1] << 8) |
|
|||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
inline u16 swap16(u16 _data) {return _byteswap_ushort(_data);}
|
||||
inline u32 swap32(u32 _data) {return _byteswap_ulong (_data);}
|
||||
inline u64 swap64(u64 _data) {return _byteswap_uint64(_data);}
|
||||
inline u16 swap16(u16 _data)
|
||||
{
|
||||
return _byteswap_ushort(_data);
|
||||
}
|
||||
inline u32 swap32(u32 _data)
|
||||
{
|
||||
return _byteswap_ulong(_data);
|
||||
}
|
||||
inline u64 swap64(u64 _data)
|
||||
{
|
||||
return _byteswap_uint64(_data);
|
||||
}
|
||||
#elif __linux__ && !(ANDROID && _M_ARM_64)
|
||||
// Android NDK r10c has broken builtin byte swap routines
|
||||
// Disabled for now.
|
||||
inline u16 swap16(u16 _data) {return bswap_16(_data);}
|
||||
inline u32 swap32(u32 _data) {return bswap_32(_data);}
|
||||
inline u64 swap64(u64 _data) {return bswap_64(_data);}
|
||||
inline u16 swap16(u16 _data)
|
||||
{
|
||||
return bswap_16(_data);
|
||||
}
|
||||
inline u32 swap32(u32 _data)
|
||||
{
|
||||
return bswap_32(_data);
|
||||
}
|
||||
inline u64 swap64(u64 _data)
|
||||
{
|
||||
return bswap_64(_data);
|
||||
}
|
||||
#elif __APPLE__
|
||||
inline __attribute__((always_inline)) u16 swap16(u16 _data)
|
||||
{return OSSwapInt16(_data);}
|
||||
{
|
||||
return OSSwapInt16(_data);
|
||||
}
|
||||
inline __attribute__((always_inline)) u32 swap32(u32 _data)
|
||||
{return OSSwapInt32(_data);}
|
||||
{
|
||||
return OSSwapInt32(_data);
|
||||
}
|
||||
inline __attribute__((always_inline)) u64 swap64(u64 _data)
|
||||
{return OSSwapInt64(_data);}
|
||||
{
|
||||
return OSSwapInt64(_data);
|
||||
}
|
||||
#elif __FreeBSD__
|
||||
inline u16 swap16(u16 _data) {return bswap16(_data);}
|
||||
inline u32 swap32(u32 _data) {return bswap32(_data);}
|
||||
inline u64 swap64(u64 _data) {return bswap64(_data);}
|
||||
inline u16 swap16(u16 _data)
|
||||
{
|
||||
return bswap16(_data);
|
||||
}
|
||||
inline u32 swap32(u32 _data)
|
||||
{
|
||||
return bswap32(_data);
|
||||
}
|
||||
inline u64 swap64(u64 _data)
|
||||
{
|
||||
return bswap64(_data);
|
||||
}
|
||||
#else
|
||||
// Slow generic implementation.
|
||||
inline u16 swap16(u16 data) {return (data >> 8) | (data << 8);}
|
||||
inline u32 swap32(u32 data) {return (swap16(data) << 16) | swap16(data >> 16);}
|
||||
inline u64 swap64(u64 data) {return ((u64)swap32(data) << 32) | swap32(data >> 32);}
|
||||
inline u16 swap16(u16 data)
|
||||
{
|
||||
return (data >> 8) | (data << 8);
|
||||
}
|
||||
inline u32 swap32(u32 data)
|
||||
{
|
||||
return (swap16(data) << 16) | swap16(data >> 16);
|
||||
}
|
||||
inline u64 swap64(u64 data)
|
||||
{
|
||||
return ((u64)swap32(data) << 32) | swap32(data >> 32);
|
||||
}
|
||||
#endif
|
||||
|
||||
inline u16 swap16(const u8* _pData) {return swap16(*(const u16*)_pData);}
|
||||
inline u32 swap32(const u8* _pData) {return swap32(*(const u32*)_pData);}
|
||||
inline u64 swap64(const u8* _pData) {return swap64(*(const u64*)_pData);}
|
||||
inline u16 swap16(const u8* _pData)
|
||||
{
|
||||
return swap16(*(const u16*)_pData);
|
||||
}
|
||||
inline u32 swap32(const u8* _pData)
|
||||
{
|
||||
return swap32(*(const u32*)_pData);
|
||||
}
|
||||
inline u64 swap64(const u8* _pData)
|
||||
{
|
||||
return swap64(*(const u64*)_pData);
|
||||
}
|
||||
|
||||
template <int count>
|
||||
void swap(u8*);
|
||||
|
|
|
@ -11,35 +11,35 @@
|
|||
// The user data dir
|
||||
#define ROOT_DIR "."
|
||||
#ifdef _WIN32
|
||||
#define USERDATA_DIR "User"
|
||||
#define DOLPHIN_DATA_DIR "Dolphin"
|
||||
#define USERDATA_DIR "User"
|
||||
#define DOLPHIN_DATA_DIR "Dolphin"
|
||||
#elif defined __APPLE__
|
||||
// On OS X, USERDATA_DIR exists within the .app, but *always* reference
|
||||
// the copy in Application Support instead! (Copied on first run)
|
||||
// You can use the File::GetUserPath() util for this
|
||||
#define USERDATA_DIR "Contents/Resources/User"
|
||||
#define DOLPHIN_DATA_DIR "Library/Application Support/Dolphin"
|
||||
#define USERDATA_DIR "Contents/Resources/User"
|
||||
#define DOLPHIN_DATA_DIR "Library/Application Support/Dolphin"
|
||||
#elif defined ANDROID
|
||||
#define USERDATA_DIR "user"
|
||||
#define DOLPHIN_DATA_DIR "/sdcard/dolphin-emu"
|
||||
#define USERDATA_DIR "user"
|
||||
#define DOLPHIN_DATA_DIR "/sdcard/dolphin-emu"
|
||||
#else
|
||||
#define USERDATA_DIR "user"
|
||||
#define DOLPHIN_DATA_DIR "dolphin-emu"
|
||||
#define USERDATA_DIR "user"
|
||||
#define DOLPHIN_DATA_DIR "dolphin-emu"
|
||||
#endif
|
||||
|
||||
// Shared data dirs (Sys and shared User for Linux)
|
||||
#if defined(_WIN32) || defined(LINUX_LOCAL_DEV)
|
||||
#define SYSDATA_DIR "Sys"
|
||||
#define SYSDATA_DIR "Sys"
|
||||
#elif defined __APPLE__
|
||||
#define SYSDATA_DIR "Contents/Resources/Sys"
|
||||
#define SYSDATA_DIR "Contents/Resources/Sys"
|
||||
#elif defined ANDROID
|
||||
#define SYSDATA_DIR "/sdcard/dolphin-emu"
|
||||
#define SYSDATA_DIR "/sdcard/dolphin-emu"
|
||||
#else
|
||||
#ifdef DATA_DIR
|
||||
#define SYSDATA_DIR DATA_DIR "sys"
|
||||
#else
|
||||
#define SYSDATA_DIR "sys"
|
||||
#endif
|
||||
#ifdef DATA_DIR
|
||||
#define SYSDATA_DIR DATA_DIR "sys"
|
||||
#else
|
||||
#define SYSDATA_DIR "sys"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Dirs in both User and Sys
|
||||
|
@ -80,6 +80,9 @@
|
|||
// This one is only used to remove it if it was present
|
||||
#define SHADERCACHE_LEGACY_DIR "ShaderCache"
|
||||
|
||||
// The theme directory used by default
|
||||
#define DEFAULT_THEME_DIR "Clean"
|
||||
|
||||
// Subdirectory names for post-processing shader types
|
||||
#define POSTPROCESSING_SHADER_SUBDIR "Postprocessing"
|
||||
#define SCALING_SHADER_SUBDIR "Scaling"
|
||||
|
|
|
@ -22,7 +22,8 @@ int bn_compare(const u8* a, const u8* b, u32 n)
|
|||
{
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if (a[i] < b[i])
|
||||
return -1;
|
||||
if (a[i] > b[i])
|
||||
|
@ -39,7 +40,8 @@ void bn_sub_modulus(u8* a, const u8* N, u32 n)
|
|||
u8 c;
|
||||
|
||||
c = 0;
|
||||
for (i = n - 1; i < n; i--) {
|
||||
for (i = n - 1; i < n; i--)
|
||||
{
|
||||
dig = N[i] + c;
|
||||
c = (a[i] < dig);
|
||||
a[i] -= dig;
|
||||
|
@ -53,7 +55,8 @@ void bn_add(u8* d, const u8* a, const u8* b, const u8* N, u32 n)
|
|||
u8 c;
|
||||
|
||||
c = 0;
|
||||
for (i = n - 1; i < n; i--) {
|
||||
for (i = n - 1; i < n; i--)
|
||||
{
|
||||
dig = a[i] + b[i] + c;
|
||||
c = (dig >= 0x100);
|
||||
d[i] = dig;
|
||||
|
@ -74,7 +77,8 @@ void bn_mul(u8* d, const u8* a, const u8* b, const u8* N, u32 n)
|
|||
bn_zero(d, n);
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
for (mask = 0x80; mask != 0; mask >>= 1) {
|
||||
for (mask = 0x80; mask != 0; mask >>= 1)
|
||||
{
|
||||
bn_add(d, d, d, N, n);
|
||||
if ((a[i] & mask) != 0)
|
||||
bn_add(d, d, b, N, n);
|
||||
|
@ -88,9 +92,10 @@ void bn_exp(u8* d, const u8* a, const u8* N, u32 n, const u8* e, u32 en)
|
|||
u8 mask;
|
||||
|
||||
bn_zero(d, n);
|
||||
d[n-1] = 1;
|
||||
d[n - 1] = 1;
|
||||
for (i = 0; i < en; i++)
|
||||
for (mask = 0x80; mask != 0; mask >>= 1) {
|
||||
for (mask = 0x80; mask != 0; mask >>= 1)
|
||||
{
|
||||
bn_mul(t, d, d, N, n);
|
||||
if ((e[i] & mask) != 0)
|
||||
bn_mul(d, t, a, N, n);
|
||||
|
@ -106,7 +111,7 @@ void bn_inv(u8* d, const u8* a, const u8* N, u32 n)
|
|||
|
||||
bn_copy(t, N, n);
|
||||
bn_zero(s, n);
|
||||
s[n-1] = 2;
|
||||
s[n - 1] = 2;
|
||||
bn_sub_modulus(t, s, n);
|
||||
bn_exp(d, a, N, n, t, n);
|
||||
}
|
||||
|
|
|
@ -17,20 +17,20 @@
|
|||
|
||||
// y**2 + x*y = x**3 + x + b
|
||||
UNUSED static const u8 ec_b[30] =
|
||||
{0x00,0x66,0x64,0x7e,0xde,0x6c,0x33,0x2c,0x7f,0x8c,0x09,0x23,0xbb,0x58,0x21
|
||||
,0x3b,0x33,0x3b,0x20,0xe9,0xce,0x42,0x81,0xfe,0x11,0x5f,0x7d,0x8f,0x90,0xad};
|
||||
{0x00,0x66,0x64,0x7e,0xde,0x6c,0x33,0x2c,0x7f,0x8c,0x09,0x23,0xbb,0x58,0x21
|
||||
,0x3b,0x33,0x3b,0x20,0xe9,0xce,0x42,0x81,0xfe,0x11,0x5f,0x7d,0x8f,0x90,0xad};
|
||||
|
||||
// order of the addition group of points
|
||||
static const u8 ec_N[30] =
|
||||
{0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x13,0xe9,0x74,0xe7,0x2f,0x8a,0x69,0x22,0x03,0x1d,0x26,0x03,0xcf,0xe0,0xd7};
|
||||
{0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x13,0xe9,0x74,0xe7,0x2f,0x8a,0x69,0x22,0x03,0x1d,0x26,0x03,0xcf,0xe0,0xd7};
|
||||
|
||||
// base point
|
||||
static const u8 ec_G[60] =
|
||||
{0x00,0xfa,0xc9,0xdf,0xcb,0xac,0x83,0x13,0xbb,0x21,0x39,0xf1,0xbb,0x75,0x5f
|
||||
,0xef,0x65,0xbc,0x39,0x1f,0x8b,0x36,0xf8,0xf8,0xeb,0x73,0x71,0xfd,0x55,0x8b
|
||||
,0x01,0x00,0x6a,0x08,0xa4,0x19,0x03,0x35,0x06,0x78,0xe5,0x85,0x28,0xbe,0xbf
|
||||
,0x8a,0x0b,0xef,0xf8,0x67,0xa7,0xca,0x36,0x71,0x6f,0x7e,0x01,0xf8,0x10,0x52};
|
||||
{0x00,0xfa,0xc9,0xdf,0xcb,0xac,0x83,0x13,0xbb,0x21,0x39,0xf1,0xbb,0x75,0x5f
|
||||
,0xef,0x65,0xbc,0x39,0x1f,0x8b,0x36,0xf8,0xf8,0xeb,0x73,0x71,0xfd,0x55,0x8b
|
||||
,0x01,0x00,0x6a,0x08,0xa4,0x19,0x03,0x35,0x06,0x78,0xe5,0x85,0x28,0xbe,0xbf
|
||||
,0x8a,0x0b,0xef,0xf8,0x67,0xa7,0xca,0x36,0x71,0x6f,0x7e,0x01,0xf8,0x10,0x52};
|
||||
|
||||
static void elt_copy(u8* d, const u8* a)
|
||||
{
|
||||
|
@ -69,7 +69,8 @@ static void elt_mul_x(u8* d, const u8* a)
|
|||
carry = a[0] & 1;
|
||||
|
||||
x = 0;
|
||||
for (i = 0; i < 29; i++) {
|
||||
for (i = 0; i < 29; i++)
|
||||
{
|
||||
y = a[i + 1];
|
||||
d[i] = x ^ (y >> 7);
|
||||
x = y << 1;
|
||||
|
@ -88,14 +89,16 @@ static void elt_mul(u8* d, const u8* a, const u8* b)
|
|||
|
||||
i = 0;
|
||||
mask = 1;
|
||||
for (n = 0; n < 233; n++) {
|
||||
for (n = 0; n < 233; n++)
|
||||
{
|
||||
elt_mul_x(d, d);
|
||||
|
||||
if ((a[i] & mask) != 0)
|
||||
elt_add(d, d, b);
|
||||
|
||||
mask >>= 1;
|
||||
if (mask == 0) {
|
||||
if (mask == 0)
|
||||
{
|
||||
mask = 0x80;
|
||||
i++;
|
||||
}
|
||||
|
@ -103,15 +106,16 @@ static void elt_mul(u8* d, const u8* a, const u8* b)
|
|||
}
|
||||
|
||||
static const u8 square[16] =
|
||||
{0x00,0x01,0x04,0x05,0x10,0x11,0x14,0x15,0x40,0x41,0x44,0x45,0x50,0x51,0x54,0x55};
|
||||
{0x00,0x01,0x04,0x05,0x10,0x11,0x14,0x15,0x40,0x41,0x44,0x45,0x50,0x51,0x54,0x55};
|
||||
|
||||
static void elt_square_to_wide(u8* d, const u8* a)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < 30; i++) {
|
||||
d[2*i] = square[a[i] >> 4];
|
||||
d[2*i + 1] = square[a[i] & 15];
|
||||
for (i = 0; i < 30; i++)
|
||||
{
|
||||
d[2 * i] = square[a[i] >> 4];
|
||||
d[2 * i + 1] = square[a[i] & 15];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -120,7 +124,8 @@ static void wide_reduce(u8* d)
|
|||
u32 i;
|
||||
u8 x;
|
||||
|
||||
for (i = 0; i < 30; i++) {
|
||||
for (i = 0; i < 30; i++)
|
||||
{
|
||||
x = d[i];
|
||||
|
||||
d[i + 19] ^= x >> 7;
|
||||
|
@ -155,7 +160,8 @@ static void itoh_tsujii(u8* d, const u8* a, const u8* b, u32 j)
|
|||
u8 t[30];
|
||||
|
||||
elt_copy(t, a);
|
||||
while (j--) {
|
||||
while (j--)
|
||||
{
|
||||
elt_square(d, t);
|
||||
elt_copy(t, d);
|
||||
}
|
||||
|
@ -221,7 +227,8 @@ static void point_double(u8* r, const u8* p)
|
|||
rx = r;
|
||||
ry = r + 30;
|
||||
|
||||
if (elt_is_zero(px)) {
|
||||
if (elt_is_zero(px))
|
||||
{
|
||||
elt_zero(rx);
|
||||
elt_zero(ry);
|
||||
|
||||
|
@ -256,13 +263,15 @@ static void point_add(u8* r, const u8* p, const u8* q)
|
|||
rx = r;
|
||||
ry = r + 30;
|
||||
|
||||
if (point_is_zero(p)) {
|
||||
if (point_is_zero(p))
|
||||
{
|
||||
elt_copy(rx, qx);
|
||||
elt_copy(ry, qy);
|
||||
return;
|
||||
}
|
||||
|
||||
if (point_is_zero(q)) {
|
||||
if (point_is_zero(q))
|
||||
{
|
||||
elt_copy(rx, px);
|
||||
elt_copy(ry, py);
|
||||
return;
|
||||
|
@ -270,11 +279,13 @@ static void point_add(u8* r, const u8* p, const u8* q)
|
|||
|
||||
elt_add(u, px, qx);
|
||||
|
||||
if (elt_is_zero(u)) {
|
||||
if (elt_is_zero(u))
|
||||
{
|
||||
elt_add(u, py, qy);
|
||||
if (elt_is_zero(u))
|
||||
point_double(r, p);
|
||||
else {
|
||||
else
|
||||
{
|
||||
elt_zero(rx);
|
||||
elt_zero(ry);
|
||||
}
|
||||
|
@ -306,7 +317,8 @@ static void point_mul(u8* d, const u8* a, const u8* b) // a is bignum
|
|||
elt_zero(d + 30);
|
||||
|
||||
for (i = 0; i < 30; i++)
|
||||
for (mask = 0x80; mask != 0; mask >>= 1) {
|
||||
for (mask = 0x80; mask != 0; mask >>= 1)
|
||||
{
|
||||
point_double(d, d);
|
||||
if ((a[i] & mask) != 0)
|
||||
point_add(d, d, b);
|
||||
|
@ -316,11 +328,11 @@ static void point_mul(u8* d, const u8* a, const u8* b) // a is bignum
|
|||
static void silly_random(u8 * rndArea, u8 count)
|
||||
{
|
||||
u16 i;
|
||||
srand((unsigned) (time(nullptr)));
|
||||
srand((unsigned)(time(nullptr)));
|
||||
|
||||
for (i=0;i<count;i++)
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
rndArea[i]=rand();
|
||||
rndArea[i] = rand();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,31 +10,77 @@
|
|||
class DebugInterface
|
||||
{
|
||||
protected:
|
||||
virtual ~DebugInterface() {}
|
||||
virtual ~DebugInterface()
|
||||
{}
|
||||
|
||||
public:
|
||||
virtual std::string Disassemble(unsigned int /*address*/) { return "NODEBUGGER"; }
|
||||
virtual void GetRawMemoryString(int /*memory*/, unsigned int /*address*/, char* dest, int /*max_size*/) {strcpy(dest, "NODEBUGGER");}
|
||||
virtual int GetInstructionSize(int /*instruction*/) {return 1;}
|
||||
virtual bool IsAlive() {return true;}
|
||||
virtual bool IsBreakpoint(unsigned int /*address*/) {return false;}
|
||||
virtual void SetBreakpoint(unsigned int /*address*/){}
|
||||
virtual void ClearBreakpoint(unsigned int /*address*/){}
|
||||
virtual void ClearAllBreakpoints() {}
|
||||
virtual void ToggleBreakpoint(unsigned int /*address*/){}
|
||||
virtual void AddWatch(unsigned int /*address*/){}
|
||||
virtual void ClearAllMemChecks() {}
|
||||
virtual bool IsMemCheck(unsigned int /*address*/) {return false;}
|
||||
virtual void ToggleMemCheck(unsigned int /*address*/){}
|
||||
virtual unsigned int ReadMemory(unsigned int /*address*/){return 0;}
|
||||
virtual void WriteExtraMemory(int /*memory*/, unsigned int /*value*/, unsigned int /*address*/) {}
|
||||
virtual unsigned int ReadExtraMemory(int /*memory*/, unsigned int /*address*/){return 0;}
|
||||
virtual unsigned int ReadInstruction(unsigned int /*address*/){return 0;}
|
||||
virtual unsigned int GetPC() {return 0;}
|
||||
virtual void SetPC(unsigned int /*address*/) {}
|
||||
virtual void Step() {}
|
||||
virtual void RunToBreakpoint() {}
|
||||
virtual void InsertBLR(unsigned int /*address*/, unsigned int /*value*/) {}
|
||||
virtual int GetColor(unsigned int /*address*/){return 0xFFFFFFFF;}
|
||||
virtual std::string Disassemble(unsigned int /*address*/)
|
||||
{
|
||||
return "NODEBUGGER";
|
||||
}
|
||||
virtual void GetRawMemoryString(int /*memory*/, unsigned int /*address*/, char* dest, int /*max_size*/)
|
||||
{
|
||||
strcpy(dest, "NODEBUGGER");
|
||||
}
|
||||
virtual int GetInstructionSize(int /*instruction*/)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
virtual bool IsAlive()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
virtual bool IsBreakpoint(unsigned int /*address*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual void SetBreakpoint(unsigned int /*address*/)
|
||||
{}
|
||||
virtual void ClearBreakpoint(unsigned int /*address*/)
|
||||
{}
|
||||
virtual void ClearAllBreakpoints()
|
||||
{}
|
||||
virtual void ToggleBreakpoint(unsigned int /*address*/)
|
||||
{}
|
||||
virtual void AddWatch(unsigned int /*address*/)
|
||||
{}
|
||||
virtual void ClearAllMemChecks()
|
||||
{}
|
||||
virtual bool IsMemCheck(unsigned int /*address*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual void ToggleMemCheck(unsigned int /*address*/)
|
||||
{}
|
||||
virtual unsigned int ReadMemory(unsigned int /*address*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
virtual void WriteExtraMemory(int /*memory*/, unsigned int /*value*/, unsigned int /*address*/)
|
||||
{}
|
||||
virtual unsigned int ReadExtraMemory(int /*memory*/, unsigned int /*address*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
virtual unsigned int ReadInstruction(unsigned int /*address*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
virtual unsigned int GetPC()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
virtual void SetPC(unsigned int /*address*/)
|
||||
{}
|
||||
virtual void Step()
|
||||
{}
|
||||
virtual void RunToBreakpoint()
|
||||
{}
|
||||
virtual void InsertBLR(unsigned int /*address*/, unsigned int /*value*/)
|
||||
{}
|
||||
virtual int GetColor(unsigned int /*address*/)
|
||||
{
|
||||
return 0xFFFFFFFF;
|
||||
}
|
||||
virtual std::string GetDescription(unsigned int /*address*/) = 0;
|
||||
};
|
||||
|
|
|
@ -32,7 +32,7 @@ int ENET_CALLBACK InterceptCallback(ENetHost* host, ENetEvent* event)
|
|||
// wakeup packet received
|
||||
if (host->receivedDataLength == 1 && host->receivedData[0] == 0)
|
||||
{
|
||||
event->type = (ENetEventType) 42;
|
||||
event->type = (ENetEventType)42;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -42,7 +42,10 @@ public:
|
|||
return;
|
||||
|
||||
std::unique_lock<std::mutex> lk(m_mutex);
|
||||
m_condvar.wait(lk, [&]{ return m_flag.TestAndClear(); });
|
||||
m_condvar.wait(lk, [&]
|
||||
{
|
||||
return m_flag.TestAndClear();
|
||||
});
|
||||
}
|
||||
|
||||
template<class Rep, class Period>
|
||||
|
@ -53,7 +56,10 @@ public:
|
|||
|
||||
std::unique_lock<std::mutex> lk(m_mutex);
|
||||
bool signaled = m_condvar.wait_for(lk, rel_time,
|
||||
[&]{ return m_flag.TestAndClear(); });
|
||||
[&]
|
||||
{
|
||||
return m_flag.TestAndClear();
|
||||
});
|
||||
|
||||
return signaled;
|
||||
}
|
||||
|
|
|
@ -8,29 +8,29 @@
|
|||
|
||||
namespace FPURoundMode
|
||||
{
|
||||
// TODO: MSVC currently produces broken code:
|
||||
// https://connect.microsoft.com/VisualStudio/feedback/details/828892/vc-2013-miscompilation-with-enums-and-bit-fields
|
||||
// Once that is fixed, change types in SetRoundMode(), SetSIMDMode(), and in UReg_FPSCR to 'RoundMode'.
|
||||
// TODO: MSVC currently produces broken code:
|
||||
// https://connect.microsoft.com/VisualStudio/feedback/details/828892/vc-2013-miscompilation-with-enums-and-bit-fields
|
||||
// Once that is fixed, change types in SetRoundMode(), SetSIMDMode(), and in UReg_FPSCR to 'RoundMode'.
|
||||
|
||||
enum RoundMode
|
||||
{
|
||||
ROUND_NEAR = 0,
|
||||
ROUND_CHOP = 1,
|
||||
ROUND_UP = 2,
|
||||
ROUND_DOWN = 3
|
||||
};
|
||||
enum PrecisionMode
|
||||
{
|
||||
PREC_24 = 0,
|
||||
PREC_53 = 1,
|
||||
PREC_64 = 2
|
||||
};
|
||||
enum RoundMode
|
||||
{
|
||||
ROUND_NEAR = 0,
|
||||
ROUND_CHOP = 1,
|
||||
ROUND_UP = 2,
|
||||
ROUND_DOWN = 3
|
||||
};
|
||||
enum PrecisionMode
|
||||
{
|
||||
PREC_24 = 0,
|
||||
PREC_53 = 1,
|
||||
PREC_64 = 2
|
||||
};
|
||||
|
||||
void SetRoundMode(int mode);
|
||||
void SetRoundMode(int mode);
|
||||
|
||||
void SetPrecisionMode(PrecisionMode mode);
|
||||
void SetPrecisionMode(PrecisionMode mode);
|
||||
|
||||
void SetSIMDMode(int rounding_mode, bool non_ieee_mode);
|
||||
void SetSIMDMode(int rounding_mode, bool non_ieee_mode);
|
||||
|
||||
/*
|
||||
* There are two different flavors of float to int conversion:
|
||||
|
@ -39,7 +39,7 @@ namespace FPURoundMode
|
|||
* The first rounds according to the MXCSR rounding bits.
|
||||
* The second one always uses round towards zero.
|
||||
*/
|
||||
void SaveSIMDState();
|
||||
void LoadSIMDState();
|
||||
void LoadDefaultSIMDState();
|
||||
void SaveSIMDState();
|
||||
void LoadSIMDState();
|
||||
void LoadDefaultSIMDState();
|
||||
}
|
||||
|
|
|
@ -20,9 +20,9 @@ template <typename T, bool NeedSize = true>
|
|||
class FifoQueue
|
||||
{
|
||||
public:
|
||||
FifoQueue() : m_size(0)
|
||||
FifoQueue(): m_size(0)
|
||||
{
|
||||
m_write_ptr = m_read_ptr = new ElementPtr();
|
||||
m_write_ptr = m_read_ptr = new ElementPtr();
|
||||
}
|
||||
|
||||
~FifoQueue()
|
||||
|
@ -103,7 +103,8 @@ private:
|
|||
class ElementPtr
|
||||
{
|
||||
public:
|
||||
ElementPtr() : next(nullptr) {}
|
||||
ElementPtr(): next(nullptr)
|
||||
{}
|
||||
|
||||
~ElementPtr()
|
||||
{
|
||||
|
|
|
@ -17,7 +17,8 @@ static std::vector<std::string> FileSearchWithTest(const std::vector<std::string
|
|||
File::FSTEntry top = File::ScanDirectoryTree(directory, recursive);
|
||||
|
||||
std::function<void(File::FSTEntry&)> DoEntry;
|
||||
DoEntry = [&](File::FSTEntry& entry) {
|
||||
DoEntry = [&](File::FSTEntry& entry)
|
||||
{
|
||||
if (callback(entry))
|
||||
result.push_back(entry.physicalName);
|
||||
for (auto& child : entry.children)
|
||||
|
@ -35,12 +36,14 @@ static std::vector<std::string> FileSearchWithTest(const std::vector<std::string
|
|||
std::vector<std::string> DoFileSearch(const std::vector<std::string>& exts, const std::vector<std::string>& directories, bool recursive)
|
||||
{
|
||||
bool accept_all = std::find(exts.begin(), exts.end(), "") != exts.end();
|
||||
return FileSearchWithTest(directories, recursive, [&](const File::FSTEntry& entry) {
|
||||
return FileSearchWithTest(directories, recursive, [&](const File::FSTEntry& entry)
|
||||
{
|
||||
if (accept_all)
|
||||
return true;
|
||||
std::string name = entry.virtualName;
|
||||
std::transform(name.begin(), name.end(), name.begin(), ::tolower);
|
||||
return std::any_of(exts.begin(), exts.end(), [&](const std::string& ext) {
|
||||
return std::any_of(exts.begin(), exts.end(), [&](const std::string& ext)
|
||||
{
|
||||
return name.length() >= ext.length() && name.compare(name.length() - ext.length(), ext.length(), ext) == 0;
|
||||
});
|
||||
});
|
||||
|
@ -49,7 +52,8 @@ std::vector<std::string> DoFileSearch(const std::vector<std::string>& exts, cons
|
|||
// Result includes the passed directories themselves as well as their subdirectories.
|
||||
std::vector<std::string> FindSubdirectories(const std::vector<std::string>& directories, bool recursive)
|
||||
{
|
||||
return FileSearchWithTest(directories, true, [&](const File::FSTEntry& entry) {
|
||||
return FileSearchWithTest(directories, true, [&](const File::FSTEntry& entry)
|
||||
{
|
||||
return entry.isDirectory;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ bool IsDirectory(const std::string& filename)
|
|||
if (result < 0)
|
||||
{
|
||||
WARN_LOG(COMMON, "IsDirectory: stat failed on %s: %s",
|
||||
filename.c_str(), GetLastErrorMsg().c_str());
|
||||
filename.c_str(), GetLastErrorMsg().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -133,14 +133,14 @@ bool Delete(const std::string& filename)
|
|||
if (!DeleteFile(UTF8ToTStr(filename).c_str()))
|
||||
{
|
||||
WARN_LOG(COMMON, "Delete: DeleteFile failed on %s: %s",
|
||||
filename.c_str(), GetLastErrorMsg().c_str());
|
||||
filename.c_str(), GetLastErrorMsg().c_str());
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
if (unlink(filename.c_str()) == -1)
|
||||
{
|
||||
WARN_LOG(COMMON, "Delete: unlink failed on %s: %s",
|
||||
filename.c_str(), GetLastErrorMsg().c_str());
|
||||
filename.c_str(), GetLastErrorMsg().c_str());
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -247,7 +247,7 @@ bool DeleteDir(const std::string& filename)
|
|||
bool Rename(const std::string& srcFilename, const std::string& destFilename)
|
||||
{
|
||||
INFO_LOG(COMMON, "Rename: %s --> %s",
|
||||
srcFilename.c_str(), destFilename.c_str());
|
||||
srcFilename.c_str(), destFilename.c_str());
|
||||
#ifdef _WIN32
|
||||
auto sf = UTF8ToTStr(srcFilename);
|
||||
auto df = UTF8ToTStr(destFilename);
|
||||
|
@ -266,7 +266,7 @@ bool Rename(const std::string& srcFilename, const std::string& destFilename)
|
|||
return true;
|
||||
#endif
|
||||
ERROR_LOG(COMMON, "Rename: failed %s --> %s: %s",
|
||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -309,13 +309,13 @@ bool RenameSync(const std::string& srcFilename, const std::string& destFilename)
|
|||
bool Copy(const std::string& srcFilename, const std::string& destFilename)
|
||||
{
|
||||
INFO_LOG(COMMON, "Copy: %s --> %s",
|
||||
srcFilename.c_str(), destFilename.c_str());
|
||||
srcFilename.c_str(), destFilename.c_str());
|
||||
#ifdef _WIN32
|
||||
if (CopyFile(UTF8ToTStr(srcFilename).c_str(), UTF8ToTStr(destFilename).c_str(), FALSE))
|
||||
return true;
|
||||
|
||||
ERROR_LOG(COMMON, "Copy: failed %s --> %s: %s",
|
||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
return false;
|
||||
#else
|
||||
|
||||
|
@ -330,7 +330,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename)
|
|||
if (!input.is_open())
|
||||
{
|
||||
ERROR_LOG(COMMON, "Copy: input failed %s --> %s: %s",
|
||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -340,7 +340,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename)
|
|||
if (!output.IsOpen())
|
||||
{
|
||||
ERROR_LOG(COMMON, "Copy: output failed %s --> %s: %s",
|
||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -352,8 +352,8 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename)
|
|||
if (!input)
|
||||
{
|
||||
ERROR_LOG(COMMON,
|
||||
"Copy: failed reading from source, %s --> %s: %s",
|
||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
"Copy: failed reading from source, %s --> %s: %s",
|
||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -361,8 +361,8 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename)
|
|||
if (!output.WriteBytes(buffer, BSIZE))
|
||||
{
|
||||
ERROR_LOG(COMMON,
|
||||
"Copy: failed writing to output, %s --> %s: %s",
|
||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
"Copy: failed writing to output, %s --> %s: %s",
|
||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -394,12 +394,12 @@ u64 GetSize(const std::string& filename)
|
|||
#endif
|
||||
{
|
||||
DEBUG_LOG(COMMON, "GetSize: %s: %lld",
|
||||
filename.c_str(), (long long)buf.st_size);
|
||||
filename.c_str(), (long long)buf.st_size);
|
||||
return buf.st_size;
|
||||
}
|
||||
|
||||
ERROR_LOG(COMMON, "GetSize: Stat failed %s: %s",
|
||||
filename.c_str(), GetLastErrorMsg().c_str());
|
||||
filename.c_str(), GetLastErrorMsg().c_str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -424,7 +424,7 @@ u64 GetSize(FILE* f)
|
|||
if (fseeko(f, 0, SEEK_END) != 0)
|
||||
{
|
||||
ERROR_LOG(COMMON, "GetSize: seek failed %p: %s",
|
||||
f, GetLastErrorMsg().c_str());
|
||||
f, GetLastErrorMsg().c_str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -432,7 +432,7 @@ u64 GetSize(FILE* f)
|
|||
if ((size != pos) && (fseeko(f, pos, SEEK_SET) != 0))
|
||||
{
|
||||
ERROR_LOG(COMMON, "GetSize: seek failed %p: %s",
|
||||
f, GetLastErrorMsg().c_str());
|
||||
f, GetLastErrorMsg().c_str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -447,7 +447,7 @@ bool CreateEmptyFile(const std::string& filename)
|
|||
if (!File::IOFile(filename, "wb"))
|
||||
{
|
||||
ERROR_LOG(COMMON, "CreateEmptyFile: failed %s: %s",
|
||||
filename.c_str(), GetLastErrorMsg().c_str());
|
||||
filename.c_str(), GetLastErrorMsg().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -484,38 +484,38 @@ FSTEntry ScanDirectoryTree(const std::string& directory, bool recursive)
|
|||
|
||||
DIR* dirp = opendir(directory.c_str());
|
||||
if (!dirp)
|
||||
return parent_entry;
|
||||
return parent_entry;
|
||||
|
||||
// non Windows loop
|
||||
while (!readdir_r(dirp, &dirent, &result) && result)
|
||||
// non Windows loop
|
||||
while (!readdir_r(dirp, &dirent, &result) && result)
|
||||
{
|
||||
const std::string virtual_name(result->d_name);
|
||||
#endif
|
||||
if (virtual_name == "." || virtual_name == "..")
|
||||
continue;
|
||||
auto physical_name = directory + DIR_SEP + virtual_name;
|
||||
FSTEntry entry;
|
||||
entry.isDirectory = IsDirectory(physical_name);
|
||||
if (entry.isDirectory)
|
||||
{
|
||||
const std::string virtual_name(result->d_name);
|
||||
#endif
|
||||
if (virtual_name == "." || virtual_name == "..")
|
||||
continue;
|
||||
auto physical_name = directory + DIR_SEP + virtual_name;
|
||||
FSTEntry entry;
|
||||
entry.isDirectory = IsDirectory(physical_name);
|
||||
if (entry.isDirectory)
|
||||
{
|
||||
if (recursive)
|
||||
entry = ScanDirectoryTree(physical_name, true);
|
||||
else
|
||||
entry.size = 0;
|
||||
parent_entry.size += entry.size;
|
||||
}
|
||||
if (recursive)
|
||||
entry = ScanDirectoryTree(physical_name, true);
|
||||
else
|
||||
{
|
||||
entry.size = GetSize(physical_name);
|
||||
}
|
||||
entry.virtualName = virtual_name;
|
||||
entry.physicalName = physical_name;
|
||||
entry.size = 0;
|
||||
parent_entry.size += entry.size;
|
||||
}
|
||||
else
|
||||
{
|
||||
entry.size = GetSize(physical_name);
|
||||
}
|
||||
entry.virtualName = virtual_name;
|
||||
entry.physicalName = physical_name;
|
||||
|
||||
++parent_entry.size;
|
||||
// Push into the tree
|
||||
parent_entry.children.push_back(entry);
|
||||
#ifdef _WIN32
|
||||
} while (FindNextFile(hFind, &ffd) != 0);
|
||||
++parent_entry.size;
|
||||
// Push into the tree
|
||||
parent_entry.children.push_back(entry);
|
||||
#ifdef _WIN32
|
||||
} while (FindNextFile(hFind, &ffd) != 0);
|
||||
FindClose(hFind);
|
||||
#else
|
||||
}
|
||||
|
@ -562,7 +562,7 @@ bool DeleteDirRecursively(const std::string& directory)
|
|||
// check for "." and ".."
|
||||
if (((virtualName[0] == '.') && (virtualName[1] == '\0')) ||
|
||||
((virtualName[0] == '.') && (virtualName[1] == '.') &&
|
||||
(virtualName[2] == '\0')))
|
||||
(virtualName[2] == '\0')))
|
||||
continue;
|
||||
|
||||
std::string newPath = directory + DIR_SEP_CHR + virtualName;
|
||||
|
@ -654,7 +654,7 @@ std::string GetCurrentDir()
|
|||
if (!(dir = __getcwd(nullptr, 0)))
|
||||
{
|
||||
ERROR_LOG(COMMON, "GetCurrentDirectory failed: %s",
|
||||
GetLastErrorMsg().c_str());
|
||||
GetLastErrorMsg().c_str());
|
||||
return nullptr;
|
||||
}
|
||||
std::string strDir = dir;
|
||||
|
@ -686,7 +686,7 @@ std::string CreateTempDir()
|
|||
dir = ReplaceAll(dir, "\\", DIR_SEP);
|
||||
return dir;
|
||||
#else
|
||||
const char* base = getenv("TMPDIR") ?: "/tmp";
|
||||
const char* base = getenv("TMPDIR") ? : "/tmp";
|
||||
std::string path = std::string(base) + "/DolphinWii.XXXXXX";
|
||||
if (!mkdtemp(&path[0]))
|
||||
return "";
|
||||
|
@ -777,41 +777,41 @@ static void RebuildUserDirectories(unsigned int dir_index)
|
|||
switch (dir_index)
|
||||
{
|
||||
case D_USER_IDX:
|
||||
s_user_paths[D_GCUSER_IDX] = s_user_paths[D_USER_IDX] + GC_USER_DIR DIR_SEP;
|
||||
s_user_paths[D_WIIROOT_IDX] = s_user_paths[D_USER_IDX] + WII_USER_DIR;
|
||||
s_user_paths[D_CONFIG_IDX] = s_user_paths[D_USER_IDX] + CONFIG_DIR DIR_SEP;
|
||||
s_user_paths[D_GAMESETTINGS_IDX] = s_user_paths[D_USER_IDX] + GAMESETTINGS_DIR DIR_SEP;
|
||||
s_user_paths[D_MAPS_IDX] = s_user_paths[D_USER_IDX] + MAPS_DIR DIR_SEP;
|
||||
s_user_paths[D_CACHE_IDX] = s_user_paths[D_USER_IDX] + CACHE_DIR DIR_SEP;
|
||||
s_user_paths[D_SHADERCACHE_IDX] = s_user_paths[D_CACHE_IDX] + SHADERCACHE_DIR DIR_SEP;
|
||||
s_user_paths[D_GCUSER_IDX] = s_user_paths[D_USER_IDX] + GC_USER_DIR DIR_SEP;
|
||||
s_user_paths[D_WIIROOT_IDX] = s_user_paths[D_USER_IDX] + WII_USER_DIR;
|
||||
s_user_paths[D_CONFIG_IDX] = s_user_paths[D_USER_IDX] + CONFIG_DIR DIR_SEP;
|
||||
s_user_paths[D_GAMESETTINGS_IDX] = s_user_paths[D_USER_IDX] + GAMESETTINGS_DIR DIR_SEP;
|
||||
s_user_paths[D_MAPS_IDX] = s_user_paths[D_USER_IDX] + MAPS_DIR DIR_SEP;
|
||||
s_user_paths[D_CACHE_IDX] = s_user_paths[D_USER_IDX] + CACHE_DIR DIR_SEP;
|
||||
s_user_paths[D_SHADERCACHE_IDX] = s_user_paths[D_CACHE_IDX] + SHADERCACHE_DIR DIR_SEP;
|
||||
s_user_paths[D_SHADERUIDCACHE_IDX] = s_user_paths[D_CACHE_IDX] + SHADERUIDCACHE_DIR DIR_SEP;
|
||||
s_user_paths[D_SHADERS_IDX] = s_user_paths[D_USER_IDX] + SHADERS_DIR DIR_SEP;
|
||||
s_user_paths[D_STATESAVES_IDX] = s_user_paths[D_USER_IDX] + STATESAVES_DIR DIR_SEP;
|
||||
s_user_paths[D_SCREENSHOTS_IDX] = s_user_paths[D_USER_IDX] + SCREENSHOTS_DIR DIR_SEP;
|
||||
s_user_paths[D_LOAD_IDX] = s_user_paths[D_USER_IDX] + LOAD_DIR DIR_SEP;
|
||||
s_user_paths[D_HIRESTEXTURES_IDX] = s_user_paths[D_LOAD_IDX] + HIRES_TEXTURES_DIR DIR_SEP;
|
||||
s_user_paths[D_SHADERS_IDX] = s_user_paths[D_USER_IDX] + SHADERS_DIR DIR_SEP;
|
||||
s_user_paths[D_STATESAVES_IDX] = s_user_paths[D_USER_IDX] + STATESAVES_DIR DIR_SEP;
|
||||
s_user_paths[D_SCREENSHOTS_IDX] = s_user_paths[D_USER_IDX] + SCREENSHOTS_DIR DIR_SEP;
|
||||
s_user_paths[D_LOAD_IDX] = s_user_paths[D_USER_IDX] + LOAD_DIR DIR_SEP;
|
||||
s_user_paths[D_HIRESTEXTURES_IDX] = s_user_paths[D_LOAD_IDX] + HIRES_TEXTURES_DIR DIR_SEP;
|
||||
s_user_paths[D_PPSHADERSPRESETS_IDX] = s_user_paths[D_LOAD_IDX] + PPS_PRESETS_DIR DIR_SEP;
|
||||
s_user_paths[D_DUMP_IDX] = s_user_paths[D_USER_IDX] + DUMP_DIR DIR_SEP;
|
||||
s_user_paths[D_DUMPFRAMES_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_FRAMES_DIR DIR_SEP;
|
||||
s_user_paths[D_DUMPAUDIO_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_AUDIO_DIR DIR_SEP;
|
||||
s_user_paths[D_DUMPTEXTURES_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_TEXTURES_DIR DIR_SEP;
|
||||
s_user_paths[D_DUMPDSP_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_DSP_DIR DIR_SEP;
|
||||
s_user_paths[D_LOGS_IDX] = s_user_paths[D_USER_IDX] + LOGS_DIR DIR_SEP;
|
||||
s_user_paths[D_MAILLOGS_IDX] = s_user_paths[D_LOGS_IDX] + MAIL_LOGS_DIR DIR_SEP;
|
||||
s_user_paths[D_THEMES_IDX] = s_user_paths[D_USER_IDX] + THEMES_DIR DIR_SEP;
|
||||
s_user_paths[D_PIPES_IDX] = s_user_paths[D_USER_IDX] + PIPES_DIR DIR_SEP;
|
||||
s_user_paths[F_DOLPHINCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + DOLPHIN_CONFIG;
|
||||
s_user_paths[D_DUMP_IDX] = s_user_paths[D_USER_IDX] + DUMP_DIR DIR_SEP;
|
||||
s_user_paths[D_DUMPFRAMES_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_FRAMES_DIR DIR_SEP;
|
||||
s_user_paths[D_DUMPAUDIO_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_AUDIO_DIR DIR_SEP;
|
||||
s_user_paths[D_DUMPTEXTURES_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_TEXTURES_DIR DIR_SEP;
|
||||
s_user_paths[D_DUMPDSP_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_DSP_DIR DIR_SEP;
|
||||
s_user_paths[D_LOGS_IDX] = s_user_paths[D_USER_IDX] + LOGS_DIR DIR_SEP;
|
||||
s_user_paths[D_MAILLOGS_IDX] = s_user_paths[D_LOGS_IDX] + MAIL_LOGS_DIR DIR_SEP;
|
||||
s_user_paths[D_THEMES_IDX] = s_user_paths[D_USER_IDX] + THEMES_DIR DIR_SEP;
|
||||
s_user_paths[D_PIPES_IDX] = s_user_paths[D_USER_IDX] + PIPES_DIR DIR_SEP;
|
||||
s_user_paths[F_DOLPHINCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + DOLPHIN_CONFIG;
|
||||
s_user_paths[F_DEBUGGERCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + DEBUGGER_CONFIG;
|
||||
s_user_paths[F_LOGGERCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + LOGGER_CONFIG;
|
||||
s_user_paths[F_MAINLOG_IDX] = s_user_paths[D_LOGS_IDX] + MAIN_LOG;
|
||||
s_user_paths[F_RAMDUMP_IDX] = s_user_paths[D_DUMP_IDX] + RAM_DUMP;
|
||||
s_user_paths[F_ARAMDUMP_IDX] = s_user_paths[D_DUMP_IDX] + ARAM_DUMP;
|
||||
s_user_paths[F_FAKEVMEMDUMP_IDX] = s_user_paths[D_DUMP_IDX] + FAKEVMEM_DUMP;
|
||||
s_user_paths[F_GCSRAM_IDX] = s_user_paths[D_GCUSER_IDX] + GC_SRAM;
|
||||
s_user_paths[F_LOGGERCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + LOGGER_CONFIG;
|
||||
s_user_paths[F_MAINLOG_IDX] = s_user_paths[D_LOGS_IDX] + MAIN_LOG;
|
||||
s_user_paths[F_RAMDUMP_IDX] = s_user_paths[D_DUMP_IDX] + RAM_DUMP;
|
||||
s_user_paths[F_ARAMDUMP_IDX] = s_user_paths[D_DUMP_IDX] + ARAM_DUMP;
|
||||
s_user_paths[F_FAKEVMEMDUMP_IDX] = s_user_paths[D_DUMP_IDX] + FAKEVMEM_DUMP;
|
||||
s_user_paths[F_GCSRAM_IDX] = s_user_paths[D_GCUSER_IDX] + GC_SRAM;
|
||||
|
||||
s_user_paths[D_MEMORYWATCHER_IDX] = s_user_paths[D_USER_IDX] + MEMORYWATCHER_DIR DIR_SEP;
|
||||
s_user_paths[D_MEMORYWATCHER_IDX] = s_user_paths[D_USER_IDX] + MEMORYWATCHER_DIR DIR_SEP;
|
||||
s_user_paths[F_MEMORYWATCHERLOCATIONS_IDX] = s_user_paths[D_MEMORYWATCHER_IDX] + MEMORYWATCHER_LOCATIONS;
|
||||
s_user_paths[F_MEMORYWATCHERSOCKET_IDX] = s_user_paths[D_MEMORYWATCHER_IDX] + MEMORYWATCHER_SOCKET;
|
||||
s_user_paths[F_MEMORYWATCHERSOCKET_IDX] = s_user_paths[D_MEMORYWATCHER_IDX] + MEMORYWATCHER_SOCKET;
|
||||
|
||||
// The shader cache has moved to the cache directory, so remove the old one.
|
||||
// TODO: remove that someday.
|
||||
|
@ -819,37 +819,37 @@ static void RebuildUserDirectories(unsigned int dir_index)
|
|||
break;
|
||||
|
||||
case D_CONFIG_IDX:
|
||||
s_user_paths[F_DOLPHINCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + DOLPHIN_CONFIG;
|
||||
s_user_paths[F_DOLPHINCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + DOLPHIN_CONFIG;
|
||||
s_user_paths[F_DEBUGGERCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + DEBUGGER_CONFIG;
|
||||
s_user_paths[F_LOGGERCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + LOGGER_CONFIG;
|
||||
s_user_paths[F_LOGGERCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + LOGGER_CONFIG;
|
||||
break;
|
||||
|
||||
case D_CACHE_IDX:
|
||||
s_user_paths[D_SHADERCACHE_IDX] = s_user_paths[D_CACHE_IDX] + SHADERCACHE_DIR DIR_SEP;
|
||||
s_user_paths[D_SHADERCACHE_IDX] = s_user_paths[D_CACHE_IDX] + SHADERCACHE_DIR DIR_SEP;
|
||||
s_user_paths[D_SHADERUIDCACHE_IDX] = s_user_paths[D_CACHE_IDX] + SHADERUIDCACHE_DIR DIR_SEP;
|
||||
break;
|
||||
|
||||
case D_GCUSER_IDX:
|
||||
s_user_paths[F_GCSRAM_IDX] = s_user_paths[D_GCUSER_IDX] + GC_SRAM;
|
||||
s_user_paths[F_GCSRAM_IDX] = s_user_paths[D_GCUSER_IDX] + GC_SRAM;
|
||||
break;
|
||||
|
||||
case D_DUMP_IDX:
|
||||
s_user_paths[D_DUMPFRAMES_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_FRAMES_DIR DIR_SEP;
|
||||
s_user_paths[D_DUMPAUDIO_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_AUDIO_DIR DIR_SEP;
|
||||
s_user_paths[D_DUMPTEXTURES_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_TEXTURES_DIR DIR_SEP;
|
||||
s_user_paths[D_DUMPDSP_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_DSP_DIR DIR_SEP;
|
||||
s_user_paths[F_RAMDUMP_IDX] = s_user_paths[D_DUMP_IDX] + RAM_DUMP;
|
||||
s_user_paths[F_ARAMDUMP_IDX] = s_user_paths[D_DUMP_IDX] + ARAM_DUMP;
|
||||
s_user_paths[F_FAKEVMEMDUMP_IDX] = s_user_paths[D_DUMP_IDX] + FAKEVMEM_DUMP;
|
||||
s_user_paths[D_DUMPFRAMES_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_FRAMES_DIR DIR_SEP;
|
||||
s_user_paths[D_DUMPAUDIO_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_AUDIO_DIR DIR_SEP;
|
||||
s_user_paths[D_DUMPTEXTURES_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_TEXTURES_DIR DIR_SEP;
|
||||
s_user_paths[D_DUMPDSP_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_DSP_DIR DIR_SEP;
|
||||
s_user_paths[F_RAMDUMP_IDX] = s_user_paths[D_DUMP_IDX] + RAM_DUMP;
|
||||
s_user_paths[F_ARAMDUMP_IDX] = s_user_paths[D_DUMP_IDX] + ARAM_DUMP;
|
||||
s_user_paths[F_FAKEVMEMDUMP_IDX] = s_user_paths[D_DUMP_IDX] + FAKEVMEM_DUMP;
|
||||
break;
|
||||
|
||||
case D_LOGS_IDX:
|
||||
s_user_paths[D_MAILLOGS_IDX] = s_user_paths[D_LOGS_IDX] + MAIL_LOGS_DIR DIR_SEP;
|
||||
s_user_paths[F_MAINLOG_IDX] = s_user_paths[D_LOGS_IDX] + MAIN_LOG;
|
||||
s_user_paths[D_MAILLOGS_IDX] = s_user_paths[D_LOGS_IDX] + MAIL_LOGS_DIR DIR_SEP;
|
||||
s_user_paths[F_MAINLOG_IDX] = s_user_paths[D_LOGS_IDX] + MAIN_LOG;
|
||||
break;
|
||||
|
||||
case D_LOAD_IDX:
|
||||
s_user_paths[D_HIRESTEXTURES_IDX] = s_user_paths[D_LOAD_IDX] + HIRES_TEXTURES_DIR DIR_SEP;
|
||||
s_user_paths[D_HIRESTEXTURES_IDX] = s_user_paths[D_LOAD_IDX] + HIRES_TEXTURES_DIR DIR_SEP;
|
||||
s_user_paths[D_PPSHADERSPRESETS_IDX] = s_user_paths[D_LOAD_IDX] + PPS_PRESETS_DIR DIR_SEP;
|
||||
break;
|
||||
}
|
||||
|
@ -876,12 +876,16 @@ void SetUserPath(unsigned int dir_index, const std::string& path)
|
|||
std::string GetThemeDir(const std::string& theme_name)
|
||||
{
|
||||
std::string dir = File::GetUserPath(D_THEMES_IDX) + theme_name + "/";
|
||||
if (File::Exists(dir))
|
||||
return dir;
|
||||
|
||||
// If theme does not exist in user's dir load from shared directory
|
||||
if (!File::Exists(dir))
|
||||
dir = GetSysDirectory() + THEMES_DIR "/" + theme_name + "/";
|
||||
// If the theme doesn't exist in the user dir, load from shared directory
|
||||
dir = GetSysDirectory() + THEMES_DIR "/" + theme_name + "/";
|
||||
if (File::Exists(dir))
|
||||
return dir;
|
||||
|
||||
return dir;
|
||||
// If the theme doesn't exist at all, load the default theme
|
||||
return GetSysDirectory() + THEMES_DIR "/" DEFAULT_THEME_DIR "/";
|
||||
}
|
||||
|
||||
bool WriteStringToFile(const std::string& str, const std::string& filename)
|
||||
|
@ -1020,7 +1024,7 @@ bool IOFile::Resize(u64 size)
|
|||
// TODO: handle 64bit and growing
|
||||
ftruncate(fileno(m_file), size)
|
||||
#endif
|
||||
)
|
||||
)
|
||||
m_good = false;
|
||||
|
||||
return m_good;
|
||||
|
|
|
@ -18,7 +18,8 @@
|
|||
#endif
|
||||
|
||||
// User directory indices for GetUserPath
|
||||
enum {
|
||||
enum
|
||||
{
|
||||
D_USER_IDX,
|
||||
D_GCUSER_IDX,
|
||||
D_WIIROOT_IDX, // always points to User/Wii or global user-configured directory
|
||||
|
@ -159,7 +160,7 @@ bool ReadFileToString(const std::string& filename, std::string& str);
|
|||
// simple wrapper for cstdlib file functions to
|
||||
// hopefully will make error checking easier
|
||||
// and make forgetting an fclose() harder
|
||||
class IOFile : public NonCopyable
|
||||
class IOFile: public NonCopyable
|
||||
{
|
||||
public:
|
||||
IOFile();
|
||||
|
@ -208,15 +209,27 @@ public:
|
|||
return WriteArray(reinterpret_cast<const char*>(data), length);
|
||||
}
|
||||
|
||||
bool IsOpen() const { return nullptr != m_file; }
|
||||
bool IsOpen() const
|
||||
{
|
||||
return nullptr != m_file;
|
||||
}
|
||||
|
||||
// m_good is set to false when a read, write or other function fails
|
||||
bool IsGood() const { return m_good; }
|
||||
operator void*() { return m_good ? m_file : nullptr; }
|
||||
bool IsGood() const
|
||||
{
|
||||
return m_good;
|
||||
}
|
||||
operator void*()
|
||||
{
|
||||
return m_good ? m_file : nullptr;
|
||||
}
|
||||
|
||||
std::FILE* ReleaseHandle();
|
||||
|
||||
std::FILE* GetHandle() { return m_file; }
|
||||
std::FILE* GetHandle()
|
||||
{
|
||||
return m_file;
|
||||
}
|
||||
|
||||
void SetHandle(std::FILE* file);
|
||||
|
||||
|
@ -227,7 +240,10 @@ public:
|
|||
bool Flush();
|
||||
|
||||
// clear error state
|
||||
void Clear() { m_good = true; std::clearerr(m_file); }
|
||||
void Clear()
|
||||
{
|
||||
m_good = true; std::clearerr(m_file);
|
||||
}
|
||||
|
||||
std::FILE* m_file;
|
||||
bool m_good;
|
||||
|
|
|
@ -4,38 +4,19 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <utility>
|
||||
|
||||
// STL-look-a-like interface, but name is mixed case to distinguish it clearly from the
|
||||
// real STL classes.
|
||||
|
||||
//
|
||||
// Not fully featured, no safety checking yet. Add features as needed.
|
||||
|
||||
// TODO: "inline" storage?
|
||||
|
||||
template <class T, int N>
|
||||
class FixedSizeQueue
|
||||
{
|
||||
T* storage;
|
||||
int head;
|
||||
int tail;
|
||||
int count; // sacrifice 4 bytes for a simpler implementation. may optimize away in the future.
|
||||
|
||||
// Make copy constructor private for now.
|
||||
FixedSizeQueue(FixedSizeQueue& other) {}
|
||||
|
||||
public:
|
||||
FixedSizeQueue()
|
||||
{
|
||||
storage = new T[N];
|
||||
clear();
|
||||
}
|
||||
|
||||
~FixedSizeQueue()
|
||||
{
|
||||
delete[] storage;
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
head = 0;
|
||||
|
@ -45,7 +26,7 @@ public:
|
|||
|
||||
void push(T t)
|
||||
{
|
||||
storage[tail] = t;
|
||||
storage[tail] = std::move(t);
|
||||
tail++;
|
||||
if (tail == N)
|
||||
tail = 0;
|
||||
|
@ -62,16 +43,27 @@ public:
|
|||
|
||||
T pop_front()
|
||||
{
|
||||
const T& temp = storage[head];
|
||||
T& temp = storage[head];
|
||||
pop();
|
||||
return temp;
|
||||
return std::move(temp);
|
||||
}
|
||||
|
||||
T& front() { return storage[head]; }
|
||||
const T& front() const { return storage[head]; }
|
||||
|
||||
T& front()
|
||||
{
|
||||
return storage[head];
|
||||
}
|
||||
const T& front() const
|
||||
{
|
||||
return storage[head];
|
||||
}
|
||||
size_t size() const
|
||||
{
|
||||
return count;
|
||||
}
|
||||
private:
|
||||
std::array<T, N> storage;
|
||||
int head = 0;
|
||||
int tail = 0;
|
||||
// Sacrifice 4 bytes for a simpler implementation. may optimize away in the future.
|
||||
int count = 0;
|
||||
};
|
||||
|
|
|
@ -27,7 +27,8 @@ public:
|
|||
// Declared as explicit since we do not want "= true" to work on a flag
|
||||
// object - it should be made explicit that a flag is *not* a normal
|
||||
// variable.
|
||||
explicit Flag(bool initial_value = false) : m_val(initial_value) {}
|
||||
explicit Flag(bool initial_value = false): m_val(initial_value)
|
||||
{}
|
||||
|
||||
void Set(bool val = true)
|
||||
{
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC
|
||||
|
||||
typedef void (APIENTRYP PFNDOLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
|
||||
typedef GLint (APIENTRYP PFNDOLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name);
|
||||
typedef GLint(APIENTRYP PFNDOLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name);
|
||||
|
||||
extern PFNDOLBINDFRAGDATALOCATIONINDEXEDPROC dolBindFragDataLocationIndexed;
|
||||
extern PFNDOLGETFRAGDATAINDEXPROC dolGetFragDataIndex;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include "Common/GL/GLExtensions/gl_common.h"
|
||||
|
||||
typedef void (APIENTRYP GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
|
||||
typedef void (APIENTRYP GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam);
|
||||
#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242
|
||||
#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243
|
||||
#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244
|
||||
|
@ -50,7 +50,7 @@ typedef void (APIENTRYP GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLen
|
|||
typedef void (APIENTRYP PFNDOLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
|
||||
typedef void (APIENTRYP PFNDOLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
|
||||
typedef void (APIENTRYP PFNDOLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const void *userParam);
|
||||
typedef GLuint (APIENTRYP PFNDOLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
|
||||
typedef GLuint(APIENTRYP PFNDOLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
|
||||
|
||||
extern PFNDOLDEBUGMESSAGECALLBACKARBPROC dolDebugMessageCallbackARB;
|
||||
extern PFNDOLDEBUGMESSAGECONTROLARBPROC dolDebugMessageControlARB;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
typedef void (APIENTRYP PFNDOLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
|
||||
typedef void (APIENTRYP PFNDOLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
|
||||
typedef void (APIENTRYP PFNDOLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
typedef GLenum (APIENTRYP PFNDOLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
|
||||
typedef GLenum(APIENTRYP PFNDOLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
|
||||
typedef void (APIENTRYP PFNDOLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
|
||||
typedef void (APIENTRYP PFNDOLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
|
||||
typedef void (APIENTRYP PFNDOLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
|
@ -39,8 +39,8 @@ typedef void (APIENTRYP PFNDOLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbu
|
|||
typedef void (APIENTRYP PFNDOLGENERATEMIPMAPPROC) (GLenum target);
|
||||
typedef void (APIENTRYP PFNDOLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNDOLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
typedef GLboolean (APIENTRYP PFNDOLISFRAMEBUFFERPROC) (GLuint framebuffer);
|
||||
typedef GLboolean (APIENTRYP PFNDOLISRENDERBUFFERPROC) (GLuint renderbuffer);
|
||||
typedef GLboolean(APIENTRYP PFNDOLISFRAMEBUFFERPROC) (GLuint framebuffer);
|
||||
typedef GLboolean(APIENTRYP PFNDOLISRENDERBUFFERPROC) (GLuint renderbuffer);
|
||||
typedef void (APIENTRYP PFNDOLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (APIENTRYP PFNDOLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
typedef void (APIENTRYP PFNDOLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);
|
||||
typedef void (APIENTRYP PFNDOLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers);
|
||||
typedef GLboolean (APIENTRYP PFNDOLISSAMPLERPROC) (GLuint sampler);
|
||||
typedef GLboolean(APIENTRYP PFNDOLISSAMPLERPROC) (GLuint sampler);
|
||||
typedef void (APIENTRYP PFNDOLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);
|
||||
typedef void (APIENTRYP PFNDOLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);
|
||||
typedef void (APIENTRYP PFNDOLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
|
||||
|
|
|
@ -23,10 +23,10 @@
|
|||
|
||||
#include "Common/GL/GLExtensions/gl_common.h"
|
||||
|
||||
typedef GLsync (APIENTRYP PFNDOLFENCESYNCPROC) (GLenum condition, GLbitfield flags);
|
||||
typedef GLboolean (APIENTRYP PFNDOLISSYNCPROC) (GLsync sync);
|
||||
typedef GLsync(APIENTRYP PFNDOLFENCESYNCPROC) (GLenum condition, GLbitfield flags);
|
||||
typedef GLboolean(APIENTRYP PFNDOLISSYNCPROC) (GLsync sync);
|
||||
typedef void (APIENTRYP PFNDOLDELETESYNCPROC) (GLsync sync);
|
||||
typedef GLenum (APIENTRYP PFNDOLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
typedef GLenum(APIENTRYP PFNDOLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
typedef void (APIENTRYP PFNDOLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
typedef void (APIENTRYP PFNDOLGETINTEGER64VPROC) (GLenum pname, GLint64 *data);
|
||||
typedef void (APIENTRYP PFNDOLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
|
||||
|
|
|
@ -29,7 +29,7 @@ typedef void (APIENTRYP PFNDOLBINDBUFFERBASEPROC) (GLenum target, GLuint index,
|
|||
typedef void (APIENTRYP PFNDOLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
|
||||
typedef void (APIENTRYP PFNDOLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNDOLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
|
||||
typedef GLuint (APIENTRYP PFNDOLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName);
|
||||
typedef GLuint(APIENTRYP PFNDOLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName);
|
||||
typedef void (APIENTRYP PFNDOLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNDOLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
|
||||
typedef void (APIENTRYP PFNDOLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
typedef void (APIENTRYP PFNDOLBINDVERTEXARRAYPROC) (GLuint array);
|
||||
typedef void (APIENTRYP PFNDOLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays);
|
||||
typedef void (APIENTRYP PFNDOLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
|
||||
typedef GLboolean (APIENTRYP PFNDOLISVERTEXARRAYPROC) (GLuint array);
|
||||
typedef GLboolean(APIENTRYP PFNDOLISVERTEXARRAYPROC) (GLuint array);
|
||||
|
||||
extern PFNDOLBINDVERTEXARRAYPROC dolBindVertexArray;
|
||||
extern PFNDOLDELETEVERTEXARRAYSPROC dolDeleteVertexArrays;
|
||||
|
|
|
@ -2061,362 +2061,365 @@ const GLFunc gl_function_array[] =
|
|||
|
||||
namespace GLExtensions
|
||||
{
|
||||
// Private members and functions
|
||||
static bool _isES;
|
||||
static u32 _GLVersion;
|
||||
static std::unordered_map<std::string, bool> m_extension_list;
|
||||
// Private members and functions
|
||||
static bool _isES;
|
||||
static u32 _GLVersion;
|
||||
static std::unordered_map<std::string, bool> m_extension_list;
|
||||
|
||||
// Private initialization functions
|
||||
bool InitFunctionPointers();
|
||||
// Private initialization functions
|
||||
bool InitFunctionPointers();
|
||||
|
||||
// Initializes the extension list the old way
|
||||
static void InitExtensionList21()
|
||||
{
|
||||
const char* extensions = (const char*)glGetString(GL_EXTENSIONS);
|
||||
std::string tmp(extensions);
|
||||
std::istringstream buffer(tmp);
|
||||
// Initializes the extension list the old way
|
||||
static void InitExtensionList21()
|
||||
{
|
||||
const char* extensions = (const char*)glGetString(GL_EXTENSIONS);
|
||||
std::string tmp(extensions);
|
||||
std::istringstream buffer(tmp);
|
||||
|
||||
while (buffer >> tmp)
|
||||
m_extension_list[tmp] = true;
|
||||
}
|
||||
|
||||
static void InitExtensionList()
|
||||
{
|
||||
m_extension_list.clear();
|
||||
if (_isES)
|
||||
{
|
||||
switch (_GLVersion)
|
||||
{
|
||||
default:
|
||||
case 320:
|
||||
m_extension_list["VERSION_GLES_3_2"] = true;
|
||||
case 310:
|
||||
m_extension_list["VERSION_GLES_3_1"] = true;
|
||||
case 300:
|
||||
m_extension_list["VERSION_GLES_3"] = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// We always have ES 2.0
|
||||
m_extension_list["VERSION_GLES_2"] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Some OpenGL implementations chose to not expose core extensions as extensions
|
||||
// Let's add them to the list manually depending on which version of OpenGL we have
|
||||
// We need to be slightly careful here
|
||||
// When an extension got merged in to core, the naming may have changed
|
||||
|
||||
// This has intentional fall through
|
||||
switch (_GLVersion)
|
||||
{
|
||||
default:
|
||||
case 450:
|
||||
{
|
||||
std::string gl450exts[] = {
|
||||
"GL_ARB_ES3_1_compatibility",
|
||||
"GL_ARB_clip_control",
|
||||
"GL_ARB_conditional_render_inverted",
|
||||
"GL_ARB_cull_distance",
|
||||
"GL_ARB_derivative_control",
|
||||
"GL_ARB_direct_state_access",
|
||||
"GL_ARB_get_texture_sub_image",
|
||||
"GL_ARB_robustness",
|
||||
"GL_ARB_shader_texture_image_samples",
|
||||
"GL_ARB_texture_barrier",
|
||||
"VERSION_4_5",
|
||||
};
|
||||
for (auto it : gl450exts)
|
||||
m_extension_list[it] = true;
|
||||
}
|
||||
case 440:
|
||||
{
|
||||
std::string gl440exts[] = {
|
||||
"GL_ARB_buffer_storage",
|
||||
"GL_ARB_clear_texture",
|
||||
"GL_ARB_enhanced_layouts",
|
||||
"GL_ARB_multi_bind",
|
||||
"GL_ARB_query_buffer_object",
|
||||
"GL_ARB_texture_mirror_clamp_to_edge",
|
||||
"GL_ARB_texture_stencil8",
|
||||
"GL_ARB_vertex_type_10f_11f_11f_rev",
|
||||
"VERSION_4_4",
|
||||
};
|
||||
for (auto it : gl440exts)
|
||||
m_extension_list[it] = true;
|
||||
}
|
||||
case 430:
|
||||
{
|
||||
std::string gl430exts[] = {
|
||||
"GL_ARB_ES3_compatibility",
|
||||
"GL_ARB_arrays_of_arrays",
|
||||
"GL_ARB_clear_buffer_object",
|
||||
"GL_ARB_compute_shader",
|
||||
"GL_ARB_copy_image",
|
||||
"GL_ARB_explicit_uniform_location",
|
||||
"GL_ARB_fragment_layer_viewport",
|
||||
"GL_ARB_framebuffer_no_attachments",
|
||||
"GL_ARB_internalformat_query2",
|
||||
"GL_ARB_invalidate_subdata",
|
||||
"GL_ARB_multi_draw_indirect",
|
||||
"GL_ARB_program_interface_query",
|
||||
"GL_ARB_shader_image_size",
|
||||
"GL_ARB_shader_storage_buffer_object",
|
||||
"GL_ARB_stencil_texturing",
|
||||
"GL_ARB_texture_buffer_range",
|
||||
"GL_ARB_texture_query_levels",
|
||||
"GL_ARB_texture_storage_multisample",
|
||||
"GL_ARB_texture_view",
|
||||
"GL_ARB_vertex_attrib_binding",
|
||||
"VERSION_4_3",
|
||||
};
|
||||
for (auto it : gl430exts)
|
||||
m_extension_list[it] = true;
|
||||
}
|
||||
case 420:
|
||||
{
|
||||
std::string gl420exts[] = {
|
||||
"GL_ARB_base_instance",
|
||||
"GL_ARB_compressed_texture_pixel_storage",
|
||||
"GL_ARB_conservative_depth",
|
||||
"GL_ARB_internalformat_query",
|
||||
"GL_ARB_map_buffer_alignment",
|
||||
"GL_ARB_shader_atomic_counters",
|
||||
"GL_ARB_shader_image_load_store",
|
||||
"GL_ARB_shading_language_420pack",
|
||||
"GL_ARB_shading_language_packing",
|
||||
"GL_ARB_texture_compression_BPTC",
|
||||
"GL_ARB_texture_storage",
|
||||
"GL_ARB_transform_feedback_instanced",
|
||||
"VERSION_4_2",
|
||||
};
|
||||
for (auto it : gl420exts)
|
||||
m_extension_list[it] = true;
|
||||
}
|
||||
case 410:
|
||||
{
|
||||
std::string gl410exts[] = {
|
||||
"GL_ARB_ES2_compatibility",
|
||||
"GL_ARB_get_program_binary",
|
||||
"GL_ARB_separate_shader_objects",
|
||||
"GL_ARB_shader_precision",
|
||||
"GL_ARB_vertex_attrib_64_bit",
|
||||
"GL_ARB_viewport_array",
|
||||
"VERSION_4_1",
|
||||
};
|
||||
for (auto it : gl410exts)
|
||||
m_extension_list[it] = true;
|
||||
}
|
||||
case 400:
|
||||
{
|
||||
std::string gl400exts[] = {
|
||||
"GL_ARB_draw_indirect",
|
||||
"GL_ARB_gpu_shader5",
|
||||
"GL_ARB_gpu_shader_fp64",
|
||||
"GL_ARB_sample_shading",
|
||||
"GL_ARB_shader_subroutine",
|
||||
"GL_ARB_tessellation_shader",
|
||||
"GL_ARB_texture_buffer_object_rgb32",
|
||||
"GL_ARB_texture_cube_map_array",
|
||||
"GL_ARB_texture_gather",
|
||||
"GL_ARB_texture_query_lod",
|
||||
"GL_ARB_transform_feedback2",
|
||||
"GL_ARB_transform_feedback3",
|
||||
"VERSION_4_0",
|
||||
};
|
||||
for (auto it : gl400exts)
|
||||
m_extension_list[it] = true;
|
||||
}
|
||||
case 330:
|
||||
{
|
||||
std::string gl330exts[] = {
|
||||
"GL_ARB_shader_bit_encoding",
|
||||
"GL_ARB_blend_func_extended",
|
||||
"GL_ARB_explicit_attrib_location",
|
||||
"GL_ARB_occlusion_query2",
|
||||
"GL_ARB_sampler_objects",
|
||||
"GL_ARB_texture_swizzle",
|
||||
"GL_ARB_timer_query",
|
||||
"GL_ARB_instanced_arrays",
|
||||
"GL_ARB_texture_rgb10_a2ui",
|
||||
"GL_ARB_vertex_type_2_10_10_10_rev",
|
||||
"VERSION_3_3",
|
||||
};
|
||||
for (auto it : gl330exts)
|
||||
m_extension_list[it] = true;
|
||||
}
|
||||
case 320:
|
||||
{
|
||||
std::string gl320exts[] = {
|
||||
"GL_ARB_geometry_shader4",
|
||||
"GL_ARB_sync",
|
||||
"GL_ARB_vertex_array_bgra",
|
||||
"GL_ARB_draw_elements_base_vertex",
|
||||
"GL_ARB_seamless_cube_map",
|
||||
"GL_ARB_texture_multisample",
|
||||
"GL_ARB_fragment_coord_conventions",
|
||||
"GL_ARB_provoking_vertex",
|
||||
"GL_ARB_depth_clamp",
|
||||
"VERSION_3_2",
|
||||
};
|
||||
for (auto it : gl320exts)
|
||||
m_extension_list[it] = true;
|
||||
}
|
||||
case 310:
|
||||
{
|
||||
// Can't add NV_primitive_restart since function name changed
|
||||
std::string gl310exts[] = {
|
||||
"GL_ARB_draw_instanced",
|
||||
"GL_ARB_copy_buffer",
|
||||
"GL_ARB_texture_buffer_object",
|
||||
"GL_ARB_texture_rectangle",
|
||||
"GL_ARB_uniform_buffer_object",
|
||||
//"GL_NV_primitive_restart",
|
||||
"VERSION_3_1",
|
||||
};
|
||||
for (auto it : gl310exts)
|
||||
m_extension_list[it] = true;
|
||||
}
|
||||
case 300:
|
||||
{
|
||||
// Quite a lot of these had their names changed when merged in to core
|
||||
// Disable the ones that have
|
||||
std::string gl300exts[] = {
|
||||
"GL_ARB_map_buffer_range",
|
||||
//"GL_EXT_gpu_shader4",
|
||||
//"GL_APPLE_flush_buffer_range",
|
||||
"GL_ARB_color_buffer_float",
|
||||
//"GL_NV_depth_buffer_float",
|
||||
"GL_ARB_texture_float",
|
||||
//"GL_EXT_packed_float",
|
||||
//"GL_EXT_texture_shared_exponent",
|
||||
"GL_ARB_half_float_pixel",
|
||||
//"GL_NV_half_float",
|
||||
"GL_ARB_framebuffer_object",
|
||||
//"GL_EXT_framebuffer_sRGB",
|
||||
"GL_ARB_texture_float",
|
||||
//"GL_EXT_texture_integer",
|
||||
//"GL_EXT_draw_buffers2",
|
||||
//"GL_EXT_texture_integer",
|
||||
//"GL_EXT_texture_array",
|
||||
//"GL_EXT_texture_compression_rgtc",
|
||||
//"GL_EXT_transform_feedback",
|
||||
"GL_ARB_vertex_array_object",
|
||||
//"GL_NV_conditional_render",
|
||||
"VERSION_3_0",
|
||||
};
|
||||
for (auto it : gl300exts)
|
||||
m_extension_list[it] = true;
|
||||
}
|
||||
case 210:
|
||||
case 200:
|
||||
case 150:
|
||||
case 140:
|
||||
case 130:
|
||||
case 121:
|
||||
case 120:
|
||||
case 110:
|
||||
case 100:
|
||||
break;
|
||||
}
|
||||
// So we can easily determine if we are running dekstop GL
|
||||
m_extension_list["VERSION_GL"] = true;
|
||||
}
|
||||
|
||||
if (_GLVersion < 300)
|
||||
{
|
||||
InitExtensionList21();
|
||||
return;
|
||||
}
|
||||
GLint NumExtension = 0;
|
||||
glGetIntegerv(GL_NUM_EXTENSIONS, &NumExtension);
|
||||
for (GLint i = 0; i < NumExtension; ++i)
|
||||
m_extension_list[std::string((const char*)glGetStringi(GL_EXTENSIONS, i))] = true;
|
||||
}
|
||||
static void InitVersion()
|
||||
{
|
||||
GLint major, minor;
|
||||
glGetIntegerv(GL_MAJOR_VERSION, &major);
|
||||
glGetIntegerv(GL_MINOR_VERSION, &minor);
|
||||
if (glGetError() == GL_NO_ERROR)
|
||||
_GLVersion = major * 100 + minor * 10;
|
||||
else
|
||||
_GLVersion = 210;
|
||||
}
|
||||
|
||||
static void* GetFuncAddress(const std::string& name, void **func)
|
||||
{
|
||||
*func = GLInterface->GetFuncAddress(name);
|
||||
if (*func == nullptr)
|
||||
{
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
// Give it a second try with dlsym
|
||||
*func = dlsym(RTLD_NEXT, name.c_str());
|
||||
#endif
|
||||
if (*func == nullptr)
|
||||
ERROR_LOG(VIDEO, "Couldn't load function %s", name.c_str());
|
||||
}
|
||||
return *func;
|
||||
}
|
||||
|
||||
// Public members
|
||||
u32 Version() { return _GLVersion; }
|
||||
bool Supports(const std::string& name)
|
||||
{
|
||||
return m_extension_list[name];
|
||||
}
|
||||
|
||||
bool Init()
|
||||
{
|
||||
_isES = GLInterface->GetMode() != GLInterfaceMode::MODE_OPENGL;
|
||||
|
||||
// Grab a few functions for initial checking
|
||||
// We need them to grab the extension list
|
||||
// Also to check if there is an error grabbing the version
|
||||
if (GetFuncAddress("glGetIntegerv", (void**)&glGetIntegerv) == nullptr)
|
||||
return false;
|
||||
if (GetFuncAddress("glGetString", (void**)&glGetString) == nullptr)
|
||||
return false;
|
||||
if (GetFuncAddress("glGetError", (void**)&glGetError) == nullptr)
|
||||
return false;
|
||||
|
||||
InitVersion();
|
||||
|
||||
// We need to use glGetStringi to get the extension list
|
||||
// if we are using GLES3 or a GL version greater than 2.1
|
||||
if (_GLVersion > 210 && GetFuncAddress("glGetStringi", (void**)&glGetStringi) == nullptr)
|
||||
return false;
|
||||
|
||||
InitExtensionList();
|
||||
|
||||
return InitFunctionPointers();
|
||||
}
|
||||
|
||||
// Private initialization functions
|
||||
static bool HasFeatures(const std::string& extensions)
|
||||
{
|
||||
bool result = true;
|
||||
std::string tmp;
|
||||
std::istringstream buffer(extensions);
|
||||
|
||||
while (buffer >> tmp)
|
||||
{
|
||||
if (tmp[0] == '!')
|
||||
result &= !m_extension_list[tmp.erase(0, 1)];
|
||||
else if (tmp[0] == '|')
|
||||
result |= m_extension_list[tmp.erase(0, 1)];
|
||||
else
|
||||
result &= m_extension_list[tmp];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
bool InitFunctionPointers()
|
||||
{
|
||||
bool result = true;
|
||||
for (const auto &it : gl_function_array)
|
||||
if (HasFeatures(it.requirements))
|
||||
result &= !!GetFuncAddress(it.function_name, it.function_ptr);
|
||||
return result;
|
||||
}
|
||||
while (buffer >> tmp)
|
||||
m_extension_list[tmp] = true;
|
||||
}
|
||||
|
||||
static void InitExtensionList()
|
||||
{
|
||||
m_extension_list.clear();
|
||||
if (_isES)
|
||||
{
|
||||
switch (_GLVersion)
|
||||
{
|
||||
default:
|
||||
case 320:
|
||||
m_extension_list["VERSION_GLES_3_2"] = true;
|
||||
case 310:
|
||||
m_extension_list["VERSION_GLES_3_1"] = true;
|
||||
case 300:
|
||||
m_extension_list["VERSION_GLES_3"] = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// We always have ES 2.0
|
||||
m_extension_list["VERSION_GLES_2"] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Some OpenGL implementations chose to not expose core extensions as extensions
|
||||
// Let's add them to the list manually depending on which version of OpenGL we have
|
||||
// We need to be slightly careful here
|
||||
// When an extension got merged in to core, the naming may have changed
|
||||
|
||||
// This has intentional fall through
|
||||
switch (_GLVersion)
|
||||
{
|
||||
default:
|
||||
case 450:
|
||||
{
|
||||
std::string gl450exts[] = {
|
||||
"GL_ARB_ES3_1_compatibility",
|
||||
"GL_ARB_clip_control",
|
||||
"GL_ARB_conditional_render_inverted",
|
||||
"GL_ARB_cull_distance",
|
||||
"GL_ARB_derivative_control",
|
||||
"GL_ARB_direct_state_access",
|
||||
"GL_ARB_get_texture_sub_image",
|
||||
"GL_ARB_robustness",
|
||||
"GL_ARB_shader_texture_image_samples",
|
||||
"GL_ARB_texture_barrier",
|
||||
"VERSION_4_5",
|
||||
};
|
||||
for (auto it : gl450exts)
|
||||
m_extension_list[it] = true;
|
||||
}
|
||||
case 440:
|
||||
{
|
||||
std::string gl440exts[] = {
|
||||
"GL_ARB_buffer_storage",
|
||||
"GL_ARB_clear_texture",
|
||||
"GL_ARB_enhanced_layouts",
|
||||
"GL_ARB_multi_bind",
|
||||
"GL_ARB_query_buffer_object",
|
||||
"GL_ARB_texture_mirror_clamp_to_edge",
|
||||
"GL_ARB_texture_stencil8",
|
||||
"GL_ARB_vertex_type_10f_11f_11f_rev",
|
||||
"VERSION_4_4",
|
||||
};
|
||||
for (auto it : gl440exts)
|
||||
m_extension_list[it] = true;
|
||||
}
|
||||
case 430:
|
||||
{
|
||||
std::string gl430exts[] = {
|
||||
"GL_ARB_ES3_compatibility",
|
||||
"GL_ARB_arrays_of_arrays",
|
||||
"GL_ARB_clear_buffer_object",
|
||||
"GL_ARB_compute_shader",
|
||||
"GL_ARB_copy_image",
|
||||
"GL_ARB_explicit_uniform_location",
|
||||
"GL_ARB_fragment_layer_viewport",
|
||||
"GL_ARB_framebuffer_no_attachments",
|
||||
"GL_ARB_internalformat_query2",
|
||||
"GL_ARB_invalidate_subdata",
|
||||
"GL_ARB_multi_draw_indirect",
|
||||
"GL_ARB_program_interface_query",
|
||||
"GL_ARB_shader_image_size",
|
||||
"GL_ARB_shader_storage_buffer_object",
|
||||
"GL_ARB_stencil_texturing",
|
||||
"GL_ARB_texture_buffer_range",
|
||||
"GL_ARB_texture_query_levels",
|
||||
"GL_ARB_texture_storage_multisample",
|
||||
"GL_ARB_texture_view",
|
||||
"GL_ARB_vertex_attrib_binding",
|
||||
"VERSION_4_3",
|
||||
};
|
||||
for (auto it : gl430exts)
|
||||
m_extension_list[it] = true;
|
||||
}
|
||||
case 420:
|
||||
{
|
||||
std::string gl420exts[] = {
|
||||
"GL_ARB_base_instance",
|
||||
"GL_ARB_compressed_texture_pixel_storage",
|
||||
"GL_ARB_conservative_depth",
|
||||
"GL_ARB_internalformat_query",
|
||||
"GL_ARB_map_buffer_alignment",
|
||||
"GL_ARB_shader_atomic_counters",
|
||||
"GL_ARB_shader_image_load_store",
|
||||
"GL_ARB_shading_language_420pack",
|
||||
"GL_ARB_shading_language_packing",
|
||||
"GL_ARB_texture_compression_BPTC",
|
||||
"GL_ARB_texture_storage",
|
||||
"GL_ARB_transform_feedback_instanced",
|
||||
"VERSION_4_2",
|
||||
};
|
||||
for (auto it : gl420exts)
|
||||
m_extension_list[it] = true;
|
||||
}
|
||||
case 410:
|
||||
{
|
||||
std::string gl410exts[] = {
|
||||
"GL_ARB_ES2_compatibility",
|
||||
"GL_ARB_get_program_binary",
|
||||
"GL_ARB_separate_shader_objects",
|
||||
"GL_ARB_shader_precision",
|
||||
"GL_ARB_vertex_attrib_64_bit",
|
||||
"GL_ARB_viewport_array",
|
||||
"VERSION_4_1",
|
||||
};
|
||||
for (auto it : gl410exts)
|
||||
m_extension_list[it] = true;
|
||||
}
|
||||
case 400:
|
||||
{
|
||||
std::string gl400exts[] = {
|
||||
"GL_ARB_draw_indirect",
|
||||
"GL_ARB_gpu_shader5",
|
||||
"GL_ARB_gpu_shader_fp64",
|
||||
"GL_ARB_sample_shading",
|
||||
"GL_ARB_shader_subroutine",
|
||||
"GL_ARB_tessellation_shader",
|
||||
"GL_ARB_texture_buffer_object_rgb32",
|
||||
"GL_ARB_texture_cube_map_array",
|
||||
"GL_ARB_texture_gather",
|
||||
"GL_ARB_texture_query_lod",
|
||||
"GL_ARB_transform_feedback2",
|
||||
"GL_ARB_transform_feedback3",
|
||||
"VERSION_4_0",
|
||||
};
|
||||
for (auto it : gl400exts)
|
||||
m_extension_list[it] = true;
|
||||
}
|
||||
case 330:
|
||||
{
|
||||
std::string gl330exts[] = {
|
||||
"GL_ARB_shader_bit_encoding",
|
||||
"GL_ARB_blend_func_extended",
|
||||
"GL_ARB_explicit_attrib_location",
|
||||
"GL_ARB_occlusion_query2",
|
||||
"GL_ARB_sampler_objects",
|
||||
"GL_ARB_texture_swizzle",
|
||||
"GL_ARB_timer_query",
|
||||
"GL_ARB_instanced_arrays",
|
||||
"GL_ARB_texture_rgb10_a2ui",
|
||||
"GL_ARB_vertex_type_2_10_10_10_rev",
|
||||
"VERSION_3_3",
|
||||
};
|
||||
for (auto it : gl330exts)
|
||||
m_extension_list[it] = true;
|
||||
}
|
||||
case 320:
|
||||
{
|
||||
std::string gl320exts[] = {
|
||||
"GL_ARB_geometry_shader4",
|
||||
"GL_ARB_sync",
|
||||
"GL_ARB_vertex_array_bgra",
|
||||
"GL_ARB_draw_elements_base_vertex",
|
||||
"GL_ARB_seamless_cube_map",
|
||||
"GL_ARB_texture_multisample",
|
||||
"GL_ARB_fragment_coord_conventions",
|
||||
"GL_ARB_provoking_vertex",
|
||||
"GL_ARB_depth_clamp",
|
||||
"VERSION_3_2",
|
||||
};
|
||||
for (auto it : gl320exts)
|
||||
m_extension_list[it] = true;
|
||||
}
|
||||
case 310:
|
||||
{
|
||||
// Can't add NV_primitive_restart since function name changed
|
||||
std::string gl310exts[] = {
|
||||
"GL_ARB_draw_instanced",
|
||||
"GL_ARB_copy_buffer",
|
||||
"GL_ARB_texture_buffer_object",
|
||||
"GL_ARB_texture_rectangle",
|
||||
"GL_ARB_uniform_buffer_object",
|
||||
//"GL_NV_primitive_restart",
|
||||
"VERSION_3_1",
|
||||
};
|
||||
for (auto it : gl310exts)
|
||||
m_extension_list[it] = true;
|
||||
}
|
||||
case 300:
|
||||
{
|
||||
// Quite a lot of these had their names changed when merged in to core
|
||||
// Disable the ones that have
|
||||
std::string gl300exts[] = {
|
||||
"GL_ARB_map_buffer_range",
|
||||
//"GL_EXT_gpu_shader4",
|
||||
//"GL_APPLE_flush_buffer_range",
|
||||
"GL_ARB_color_buffer_float",
|
||||
//"GL_NV_depth_buffer_float",
|
||||
"GL_ARB_texture_float",
|
||||
//"GL_EXT_packed_float",
|
||||
//"GL_EXT_texture_shared_exponent",
|
||||
"GL_ARB_half_float_pixel",
|
||||
//"GL_NV_half_float",
|
||||
"GL_ARB_framebuffer_object",
|
||||
//"GL_EXT_framebuffer_sRGB",
|
||||
"GL_ARB_texture_float",
|
||||
//"GL_EXT_texture_integer",
|
||||
//"GL_EXT_draw_buffers2",
|
||||
//"GL_EXT_texture_integer",
|
||||
//"GL_EXT_texture_array",
|
||||
//"GL_EXT_texture_compression_rgtc",
|
||||
//"GL_EXT_transform_feedback",
|
||||
"GL_ARB_vertex_array_object",
|
||||
//"GL_NV_conditional_render",
|
||||
"VERSION_3_0",
|
||||
};
|
||||
for (auto it : gl300exts)
|
||||
m_extension_list[it] = true;
|
||||
}
|
||||
case 210:
|
||||
case 200:
|
||||
case 150:
|
||||
case 140:
|
||||
case 130:
|
||||
case 121:
|
||||
case 120:
|
||||
case 110:
|
||||
case 100:
|
||||
break;
|
||||
}
|
||||
// So we can easily determine if we are running dekstop GL
|
||||
m_extension_list["VERSION_GL"] = true;
|
||||
}
|
||||
|
||||
if (_GLVersion < 300)
|
||||
{
|
||||
InitExtensionList21();
|
||||
return;
|
||||
}
|
||||
GLint NumExtension = 0;
|
||||
glGetIntegerv(GL_NUM_EXTENSIONS, &NumExtension);
|
||||
for (GLint i = 0; i < NumExtension; ++i)
|
||||
m_extension_list[std::string((const char*)glGetStringi(GL_EXTENSIONS, i))] = true;
|
||||
}
|
||||
static void InitVersion()
|
||||
{
|
||||
GLint major, minor;
|
||||
glGetIntegerv(GL_MAJOR_VERSION, &major);
|
||||
glGetIntegerv(GL_MINOR_VERSION, &minor);
|
||||
if (glGetError() == GL_NO_ERROR)
|
||||
_GLVersion = major * 100 + minor * 10;
|
||||
else
|
||||
_GLVersion = 210;
|
||||
}
|
||||
|
||||
static void* GetFuncAddress(const std::string& name, void **func)
|
||||
{
|
||||
*func = GLInterface->GetFuncAddress(name);
|
||||
if (*func == nullptr)
|
||||
{
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
// Give it a second try with dlsym
|
||||
*func = dlsym(RTLD_NEXT, name.c_str());
|
||||
#endif
|
||||
if (*func == nullptr)
|
||||
ERROR_LOG(VIDEO, "Couldn't load function %s", name.c_str());
|
||||
}
|
||||
return *func;
|
||||
}
|
||||
|
||||
// Public members
|
||||
u32 Version()
|
||||
{
|
||||
return _GLVersion;
|
||||
}
|
||||
bool Supports(const std::string& name)
|
||||
{
|
||||
return m_extension_list[name];
|
||||
}
|
||||
|
||||
bool Init()
|
||||
{
|
||||
_isES = GLInterface->GetMode() != GLInterfaceMode::MODE_OPENGL;
|
||||
|
||||
// Grab a few functions for initial checking
|
||||
// We need them to grab the extension list
|
||||
// Also to check if there is an error grabbing the version
|
||||
if (GetFuncAddress("glGetIntegerv", (void**)&glGetIntegerv) == nullptr)
|
||||
return false;
|
||||
if (GetFuncAddress("glGetString", (void**)&glGetString) == nullptr)
|
||||
return false;
|
||||
if (GetFuncAddress("glGetError", (void**)&glGetError) == nullptr)
|
||||
return false;
|
||||
|
||||
InitVersion();
|
||||
|
||||
// We need to use glGetStringi to get the extension list
|
||||
// if we are using GLES3 or a GL version greater than 2.1
|
||||
if (_GLVersion > 210 && GetFuncAddress("glGetStringi", (void**)&glGetStringi) == nullptr)
|
||||
return false;
|
||||
|
||||
InitExtensionList();
|
||||
|
||||
return InitFunctionPointers();
|
||||
}
|
||||
|
||||
// Private initialization functions
|
||||
static bool HasFeatures(const std::string& extensions)
|
||||
{
|
||||
bool result = true;
|
||||
std::string tmp;
|
||||
std::istringstream buffer(extensions);
|
||||
|
||||
while (buffer >> tmp)
|
||||
{
|
||||
if (tmp[0] == '!')
|
||||
result &= !m_extension_list[tmp.erase(0, 1)];
|
||||
else if (tmp[0] == '|')
|
||||
result |= m_extension_list[tmp.erase(0, 1)];
|
||||
else
|
||||
result &= m_extension_list[tmp];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
bool InitFunctionPointers()
|
||||
{
|
||||
bool result = true;
|
||||
for (const auto &it : gl_function_array)
|
||||
if (HasFeatures(it.requirements))
|
||||
result &= !!GetFuncAddress(it.function_name, it.function_ptr);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -50,13 +50,13 @@
|
|||
|
||||
namespace GLExtensions
|
||||
{
|
||||
// Initializes the interface
|
||||
bool Init();
|
||||
// Initializes the interface
|
||||
bool Init();
|
||||
|
||||
// Function for checking if the hardware supports an extension
|
||||
// example: if (GLExtensions::Supports("GL_ARB_multi_map"))
|
||||
bool Supports(const std::string& name);
|
||||
// Function for checking if the hardware supports an extension
|
||||
// example: if (GLExtensions::Supports("GL_ARB_multi_map"))
|
||||
bool Supports(const std::string& name);
|
||||
|
||||
// Returns OpenGL version in format 430
|
||||
u32 Version();
|
||||
// Returns OpenGL version in format 430
|
||||
u32 Version();
|
||||
}
|
||||
|
|
|
@ -64,12 +64,12 @@
|
|||
#define GL_DEBUG_SEVERITY_LOW 0x9148
|
||||
#define GL_DEBUG_OUTPUT 0x92E0
|
||||
|
||||
typedef void (APIENTRYP GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
|
||||
typedef void (APIENTRYP GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam);
|
||||
|
||||
typedef void (APIENTRYP PFNDOLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const GLvoid *userParam);
|
||||
typedef void (APIENTRYP PFNDOLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled);
|
||||
typedef void (APIENTRYP PFNDOLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf);
|
||||
typedef GLuint (APIENTRYP PFNDOLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog);
|
||||
typedef GLuint(APIENTRYP PFNDOLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog);
|
||||
typedef void (APIENTRYP PFNDOLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar *label);
|
||||
typedef void (APIENTRYP PFNDOLGETOBJECTPTRLABELPROC) (void* ptr, GLsizei bufSize, GLsizei* length, GLchar *label);
|
||||
typedef void (APIENTRYP PFNDOLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar* label);
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
typedef void (APIENTRYP PFNDOLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
|
||||
typedef void (APIENTRYP PFNDOLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
|
||||
typedef GLboolean (APIENTRYP PFNDOLISOCCLUSIONQUERYNVPROC) (GLuint id);
|
||||
typedef GLboolean(APIENTRYP PFNDOLISOCCLUSIONQUERYNVPROC) (GLuint id);
|
||||
typedef void (APIENTRYP PFNDOLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
|
||||
typedef void (APIENTRYP PFNDOLENDOCCLUSIONQUERYNVPROC) (void);
|
||||
typedef void (APIENTRYP PFNDOLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);
|
||||
|
|