Merge latest master changes

This commit is contained in:
Rodolfo Bogado 2016-05-02 23:59:11 -03:00
parent fcc4c8d937
commit 740416bef7
53 changed files with 897 additions and 501 deletions

View file

@ -0,0 +1,22 @@
# GLGP41 - Largo Winch
[Core]
# Values set here will override the main Dolphin settings.
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
EmulationIssues = Needs real xfb for the videos to work.
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Settings]
UseXFB = True
UseRealXFB = True

View file

@ -6,7 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 5
EmulationIssues =
EmulationIssues = Needs real xfb for the videos to work.
[OnLoad]
# Add memory patches to be loaded once on boot here.

View file

@ -6,7 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
EmulationIssues = Needs EFB to Ram and no texture filtering for the goo.
EmulationIssues = Needs Store EFB Copies to Texture Only disabled and Force Texture Filtering disabled for the goo. Needs Skip EFB Access from CPU disabled for making the analog stick not act as if Mario constantly is behind a tree. Needs anti-aliasing disabled for both, unless using Direct3D 12.
[OnLoad]
# Add memory patches to be loaded once on boot here.
@ -18,19 +18,13 @@ EmulationIssues = Needs EFB to Ram and no texture filtering for the goo.
# Add action replay cheats here.
[Video]
ProjectionHack = 0
PH_SZNear = 0
PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
PerfQueriesEnable = True
[Video_Hacks]
EFBToTextureEnable = False
EFBAccessEnable = True
[Video_Enhancements]
MaxAnisotropy = 0
ForceFiltering = False
[Video_Stereoscopy]

View file

@ -1,4 +1,4 @@
# NANE01 - Pokémon Puzzle
# NANE01 - Pokémon Puzzle League
[Core]
# Values set here will override the main Dolphin settings.
@ -6,7 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
EmulationIssues = Timer bug
EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.

View file

@ -2,6 +2,7 @@
[Core]
# Values set here will override the main Dolphin settings.
SyncGPU = True # Prevent CPU/GPU desync
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.

View file

@ -18,7 +18,5 @@ EmulationIssues = Needs Efb to Ram for BBox (proper graphics).
# Add action replay cheats here.
[Video_Hacks]
EFBToTextureEnable = False
[Video_Hacks]
BBoxEnable = True
EFBToTextureEnable = False # Fix transitions
BBoxEnable = True # Required for proper functionality

View file

@ -22,3 +22,6 @@ EFBEmulateFormatChanges = True
[Video_Stereoscopy]
StereoConvergence = 613
[Video_Settings]
MSAA = 0 # Avoid overbloom

View file

@ -2,6 +2,7 @@
[Core]
# Values set here will override the main Dolphin settings.
CPUThread = False # Display Mii faces correctly
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.

View file

@ -6,7 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
EmulationIssues =
EmulationIssues = Pattern editor requires force filtering disabled and safe texture cache
[OnLoad]
# Add memory patches to be loaded once on boot here.

View file

@ -1,13 +1,19 @@
# RZTE01, RZTJ01, RZTK01, RZTP01, RZTW01 - Wii Sports Resort
[Core]
# Values set here will override the main Dolphin settings.
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
EmulationIssues = Needs real wiimote and motion plus.
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame]
[ActionReplay]
[Video_Hacks]
EFBEmulateFormatChanges = True
EFBAccessEnable = True # Fix aiming

View file

@ -0,0 +1,21 @@
# SNGEJJ, SNGPLG - Get Fit with Mel B
[Core]
# Values set here will override the main Dolphin settings.
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId =
EmulationIssues = If part of the text is corrupt, increase the texture cache accuracy
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Settings]
SafeTextureCacheColorSamples = 0

View file

@ -0,0 +1,21 @@
# WPAJ01 - Pokémon Fushigi no Dungeon: Ikuzo! Arashi no Boukendan
[Core]
# Values set here will override the main Dolphin settings.
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId =
EmulationIssues = Minimap requires safe texture cache
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Settings]
SafeTextureCacheColorSamples = 0

View file

@ -0,0 +1,21 @@
# WPFJ01 - Pokémon Fushigi no Dungeon: Susume! Honoo no Boukendan
[Core]
# Values set here will override the main Dolphin settings.
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId =
EmulationIssues = Minimap requires safe texture cache
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Settings]
SafeTextureCacheColorSamples = 0

View file

@ -0,0 +1,21 @@
# WPHJ01 - Pokémon Fushigi no Dungeon: Mezase! Hikari no Boukendan
[Core]
# Values set here will override the main Dolphin settings.
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId =
EmulationIssues = Minimap requires safe texture cache
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Settings]
SafeTextureCacheColorSamples = 0

View file

@ -1,4 +1,4 @@
# WTXPJS - Texas Hold'em Tournament
# WTXEJS, WTXPJS - Texas Hold'em Tournament
[Core]
# Values set here will override the main Dolphin settings.
@ -17,3 +17,6 @@ EmulationIssues =
[ActionReplay]
# Add action replay cheats here.
[Video_Settings]
UseXFB = True
UseRealXFB = True

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,7 @@
# DefenderX <darkmodx@gmail.com>, 2013,2015
# DefenderX <darkmodx@gmail.com>, 2013
# Ettore Atalan <atalanttore@googlemail.com>, 2015-2016
# Gabriel <gabelk@web.de>, 2013
# Gabriel <gabriel-transifex@mastergk.de>, 2013
# Georg Strof <pikachu025@gmail.com>, 2015
# JackyCola <jackycola@gmail.com>, LucasX <lucasx790@gmail.com>, 2011
# Michael Grauvogl <michael.grauvogl@googlemail.com>, 2015
@ -20,7 +20,7 @@
# Shinrai, 2013
# Shinrai, 2013
# Tillmann Karras <tilkax@gmail.com>, 2014
# Valsu <valsu@hylia.de>, 2015
# valsu <valsu@hylia.de>, 2015
msgid ""
msgstr ""
"Project-Id-Version: Dolphin Emulator\n"

View file

@ -20,8 +20,8 @@ msgstr ""
"Project-Id-Version: Dolphin Emulator\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-26 22:32+0000\n"
"PO-Revision-Date: 2016-03-26 22:32+0000\n"
"Last-Translator: dolphinbot <delroth@dolphin-emu.org>\n"
"PO-Revision-Date: 2016-03-26 23:01+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"
@ -2203,6 +2203,11 @@ msgid ""
"\n"
"If unsure, select 1x."
msgstr ""
"Habilitar filtro anisotrópico.\n"
"Mejora la calidad de las texturas que tienen un ángulo de visión obliquo.\n"
"Puede causar problemas en algunos juegos.\n"
"\n"
"Si no estás seguro, elige 1x."
#: Source/Core/DolphinWX/ISOProperties.cpp:333
msgid ""
@ -2724,6 +2729,13 @@ msgid ""
"\n"
"If unsure, leave this unchecked."
msgstr ""
"Habilita el filtrado de todas las texturas, incluidas aquellas que el juego "
"marque para que no sea así.\n"
"\n"
"Puede que mejore la calidad de algunas texturas en algunos juegos, pero "
"causará problemas en otros.\n"
"\n"
"Si no estás seguro déjala sin marcar."
#: Source/Core/DolphinWX/FifoPlayerDlg.cpp:248
msgid "Find next"

View file

@ -17,8 +17,8 @@ msgstr ""
"Project-Id-Version: Dolphin Emulator\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-26 22:32+0000\n"
"PO-Revision-Date: 2016-03-26 22:32+0000\n"
"Last-Translator: dolphinbot <delroth@dolphin-emu.org>\n"
"PO-Revision-Date: 2016-03-26 23:13+0000\n"
"Last-Translator: Pascal <pascal2j-language@yahoo.com>\n"
"Language-Team: French (http://www.transifex.com/delroth/dolphin-emu/language/"
"fr/)\n"
"Language: fr\n"
@ -2196,6 +2196,12 @@ msgid ""
"\n"
"If unsure, select 1x."
msgstr ""
"Active le filtrage anisotropique.\n"
"Améliore la qualité visuelle des textures qui ont des angles de vue "
"obliques.\n"
"Peut provoquer des soucis pour un petit nombre de jeux.\n"
"\n"
"Dans le doute, sélectionnez 1x."
#: Source/Core/DolphinWX/ISOProperties.cpp:333
msgid ""
@ -2720,6 +2726,12 @@ msgid ""
"\n"
"If unsure, leave this unchecked."
msgstr ""
"Filtre toutes les textures, y compris celles que le jeu a explicitement "
"indiqué comme non filtrées.\n"
"Peut améliorer la qualité de certaines textures dans quelques jeux, mais "
"provoquera des pépins dans les autres.\n"
"\n"
"Dans le doute, décochez cette case."
#: Source/Core/DolphinWX/FifoPlayerDlg.cpp:248
msgid "Find next"

View file

@ -10,8 +10,8 @@ msgstr ""
"Project-Id-Version: Dolphin Emulator\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-26 22:32+0000\n"
"PO-Revision-Date: 2016-03-26 22:32+0000\n"
"Last-Translator: dolphinbot <delroth@dolphin-emu.org>\n"
"PO-Revision-Date: 2016-04-01 23:36+0000\n"
"Last-Translator: Mewster <mewster@libero.it>\n"
"Language-Team: Italian (http://www.transifex.com/delroth/dolphin-emu/"
"language/it/)\n"
"Language: it\n"
@ -2188,6 +2188,12 @@ msgid ""
"\n"
"If unsure, select 1x."
msgstr ""
"Abilita il filtraggio anisotropico.\n"
"Migliora la qualità visiva delle texture visualizzate ad angolazioni "
"inclinate.\n"
"Potrebbe causare problemi in una minoranza di titoli.\n"
"\n"
"Nel dubbio, seleziona 1x."
#: Source/Core/DolphinWX/ISOProperties.cpp:333
msgid ""
@ -2707,6 +2713,12 @@ msgid ""
"\n"
"If unsure, leave this unchecked."
msgstr ""
"Filtra tutte le texture, comprese quelle che il gioco dichiara "
"esplicitamente come non filtrate.\n"
"Potrebbe aumentare la qualità di alcune texture in alcuni giochi, ma causa "
"problemi in altri.\n"
"\n"
"Nel dubbio, lascia deselezionato."
#: Source/Core/DolphinWX/FifoPlayerDlg.cpp:248
msgid "Find next"

View file

@ -5,6 +5,7 @@
# Translators:
# Danbsky, 2011
# DanbSky <danbsky@live.jp>, 2015-2016
# Denton Poss <dentonposs@gmail.com>, 2016
# Katabi Oka, 2015
# Lioncash <mathew1800@gmail.com>, 2014
# Lioncash <mathew1800@gmail.com>, 2014
@ -14,8 +15,8 @@ msgstr ""
"Project-Id-Version: Dolphin Emulator\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-26 22:32+0000\n"
"PO-Revision-Date: 2016-03-26 22:32+0000\n"
"Last-Translator: dolphinbot <delroth@dolphin-emu.org>\n"
"PO-Revision-Date: 2016-04-22 15:16+0000\n"
"Last-Translator: Denton Poss <dentonposs@gmail.com>\n"
"Language-Team: Japanese (http://www.transifex.com/delroth/dolphin-emu/"
"language/ja/)\n"
"Language: ja\n"
@ -91,12 +92,12 @@ msgstr "処理中... %i (全%iブロック中) 圧縮比:%i%%"
#: Source/Core/DolphinWX/Config/GeneralConfigPane.cpp:48
#, c-format
msgid "%i%%"
msgstr ""
msgstr "%i%%"
#: Source/Core/DolphinWX/Config/GeneralConfigPane.cpp:46
#, c-format
msgid "%i%% (Normal Speed)"
msgstr ""
msgstr "%i%% (標準)"
#: Source/Core/Core/HW/GCMemcardDirectory.cpp:74
#, c-format
@ -337,7 +338,7 @@ msgstr "GCメモリーカードマネージャ(&M)"
#: Source/Core/DolphinWX/FrameTools.cpp:276
msgid "&Memory"
msgstr "&Memory"
msgstr "メモリー"
#: Source/Core/DolphinWX/FrameTools.cpp:215
msgid "&Movie"
@ -417,7 +418,7 @@ msgstr "(Error: Bad host)"
#: Source/Core/DolphinWX/NetPlay/NetWindow.cpp:58
msgid "(Error: Disconnected)"
msgstr "(Error: Disconnected)"
msgstr "(エラー:接続が切れました)"
#: Source/Core/DolphinWX/NetPlay/NetWindow.cpp:56
msgid "(Error: Dolphin too old)"
@ -425,15 +426,15 @@ msgstr "(Error: Dolphin too old)"
#: Source/Core/DolphinWX/NetPlay/NetWindow.cpp:60
msgid "(Error: Socket)"
msgstr "(Error: Socket)"
msgstr "(エラー:ソケット)"
#: Source/Core/DolphinWX/NetPlay/NetWindow.cpp:62
msgid "(Error: Timeout)"
msgstr "(Error: Timeout)"
msgstr "(エラー:タイムアウト)"
#: Source/Core/DolphinWX/NetPlay/NetWindow.cpp:64
msgid "(Error: Unknown)"
msgstr "(Error: Unknown)"
msgstr "(エラー:不詳)"
#: Source/Core/DolphinWX/AboutDolphin.cpp:33
msgid ""
@ -546,6 +547,17 @@ msgid ""
"\n"
"Wiimote support is broken in netplay and therefore disabled.\n"
msgstr ""
"~ネットプレイに関しての注意事項~\n"
"\n"
"全てのプレーヤーはDolphinのバージョンを同一に揃え、設定も統一すること。\n"
"メモリーカード/SDカード/チートコードのデータについても全員で同一のものを使う"
"か、無効にしておく。\n"
"DSP-LLEを使う場合には、各々でROMのバージョンが異なっていないか確認するこ"
"と。\n"
"直接接続の場合、ホスト側はUDPポートの開放を忘れずに \n"
"\n"
"現状ネットプレイ上でのWiiリモコンの入力サポートは壊れているため、無効になりま"
"す。\n"
#: Source/Core/DolphinWX/ControllerConfigDiag.cpp:52
#: Source/Core/DolphinWX/Config/GameCubeConfigPane.cpp:36
@ -749,7 +761,7 @@ msgstr ""
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:431
msgid "Anaglyph"
msgstr "Anaglyph"
msgstr " アナグリフ"
#: Source/Core/DolphinWX/FifoPlayerDlg.cpp:266
msgid "Analyze"
@ -806,10 +818,11 @@ msgstr "\"%s\" このプロファイルを削除しますか?"
#: Source/Core/DolphinWX/GameListCtrl.cpp:1048
msgid "Are you sure you want to delete these files? They will be gone forever!"
msgstr ""
"これら複数のタイトルの実体ファイルを削除しますか?元に戻すことはできません!"
#: Source/Core/DolphinWX/GameListCtrl.cpp:1047
msgid "Are you sure you want to delete this file? It will be gone forever!"
msgstr ""
msgstr "このタイトルの実体ファイルを削除しますか?元に戻すことはできません!"
#: Source/Core/DolphinWX/Config/GameCubeConfigPane.cpp:383
msgid "Are you trying to use the same file in both slots?"
@ -902,7 +915,7 @@ msgstr "出力設定"
#: Source/Core/DolphinWX/SoftwareVideoConfigDialog.cpp:61
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:234
msgid "Backend:"
msgstr "描画API"
msgstr "ビデオAPI:"
#: Source/Core/Core/HotkeyManager.cpp:227
#: Source/Core/Core/HW/GCKeyboardEmu.cpp:247
@ -1268,7 +1281,7 @@ msgstr "コード:"
#: Source/Core/DolphinWX/WXInputBase.cpp:40
msgid "Command"
msgstr "Command"
msgstr "コマンド"
#: Source/Core/DolphinWX/MemcardManager.cpp:646
msgid "Comment"
@ -1765,7 +1778,7 @@ msgstr "Disable Bounding Box"
#: Source/Core/Core/HotkeyManager.cpp:53
msgid "Disable Emulation Speed Limit"
msgstr ""
msgstr "エミュレーション速度 無効化"
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:417
msgid "Disable Fog"
@ -2154,6 +2167,11 @@ msgid ""
"\n"
"If unsure, select 1x."
msgstr ""
"異方性フィルタリングを適用します。\n"
"奥行きのあるテクスチャをより精細に描画することが出来ます。\n"
"特定のゲームでは描画バグの原因になることがあります。\n"
"\n"
"よく分からなければ、【1x】を選択してください。"
#: Source/Core/DolphinWX/ISOProperties.cpp:333
msgid ""
@ -2300,7 +2318,7 @@ msgstr ""
#: Source/Core/DolphinWX/FifoPlayerDlg.cpp:389
msgid "Error saving file."
msgstr ""
msgstr "エラー: ファイルをセーブしません"
#: Source/Core/Common/ChunkFile.h:295
#, c-format
@ -2575,7 +2593,7 @@ msgstr "Fast"
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:520
msgid "Fast Depth Calculation"
msgstr ""
msgstr "Fast Depth Calculation"
#: Source/Core/Core/Movie.cpp:1168
#, c-format
@ -2661,6 +2679,11 @@ msgid ""
"\n"
"If unsure, leave this unchecked."
msgstr ""
"全てのテクスチャに対してフィルタリングを行います。\n"
"いくつかのテクスチャの画質が向上しますが、テクスチャによっては 問題が発生する"
"可能性もあります。\n"
"\n"
"よく分からなければ、チェックを外さないでください。"
#: Source/Core/DolphinWX/FifoPlayerDlg.cpp:248
msgid "Find next"
@ -2771,15 +2794,15 @@ msgstr "Frame Advance"
#: Source/Core/Core/HotkeyManager.cpp:23
msgid "Frame Advance Decrease Speed"
msgstr "Frame Advance 速度減少"
msgstr "Frame Advance速度 減少"
#: Source/Core/Core/HotkeyManager.cpp:24
msgid "Frame Advance Increase Speed"
msgstr "Frame Advance 速度増加"
msgstr "Frame Advance速度 増加"
#: Source/Core/Core/HotkeyManager.cpp:25
msgid "Frame Advance Reset Speed"
msgstr "Frame Advance 速度リセット"
msgstr "Frame Advance速度 リセット"
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:563
msgid "Frame Dumps use FFV1"
@ -2811,11 +2834,11 @@ msgstr "フリールック"
#: Source/Core/Core/HotkeyManager.cpp:57
msgid "Freelook Decrease Speed"
msgstr "フリールック 速度増加"
msgstr "フリールック速度 増加"
#: Source/Core/Core/HotkeyManager.cpp:58
msgid "Freelook Increase Speed"
msgstr "フリールック 速度減少"
msgstr "フリールック速度 減少"
#: Source/Core/Core/HotkeyManager.cpp:61
msgid "Freelook Move Down"
@ -2839,7 +2862,7 @@ msgstr "フリールック リセット"
#: Source/Core/Core/HotkeyManager.cpp:59
msgid "Freelook Reset Speed"
msgstr "フリールック 速度リセット"
msgstr "フリールック速度 リセット"
#: Source/Core/Core/HotkeyManager.cpp:64
msgid "Freelook Zoom In"
@ -3334,7 +3357,7 @@ msgstr "入力"
#: Source/Core/DolphinWX/WXInputBase.cpp:55
msgid "Insert"
msgstr "Insert"
msgstr "入れます"
#: Source/Core/DolphinWX/Config/WiiConfigPane.cpp:46
msgid "Insert SD Card"
@ -3618,10 +3641,12 @@ msgid ""
"Note that raising or lowering the emulation speed will also raise or lower "
"the audio pitch to prevent audio from stuttering."
msgstr ""
"エミュレーション速度を指定された割合に制限します\n"
"標準以外の速度では音声バグを防ぐためにピッチも上下することに注意してください"
#: Source/Core/DolphinWX/InputConfigDiag.cpp:1026
msgid "Load"
msgstr "読込"
msgstr "ロード"
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:557
msgid "Load Custom Textures"
@ -3797,7 +3822,7 @@ msgstr "サーバーとの接続が切断されました!"
#: Source/Core/DolphinWX/WXInputBase.cpp:34
msgid "M Button"
msgstr "M Button"
msgstr "M ボタン"
#: Source/Core/DolphinWX/ISOProperties.cpp:475
msgid "MD5 Checksum:"
@ -6156,6 +6181,11 @@ msgid ""
"\n"
"If unsure, leave this checked."
msgstr ""
"不正確なアルゴリズムで深度の値を求めるようにします。\n"
"動作速度の向上効果はタイトルと使用GPUに左右されますが 単に問題を引き起こすだ"
"けの場合もあります。\n"
"\n"
"よく分からなければ、チェックを外さないでください。"
#: Source/Core/DolphinWX/ISOProperties.cpp:366
msgid "Use a single depth buffer for both eyes. Needed for a few games."

View file

@ -4,15 +4,16 @@
#
# Translators:
# Siegfried <iori3000@hanafos.com>, 2013-2016
# itstake <bexco2010@gmail.com>, 2015
# its take <bexco2010@gmail.com>, 2016
# its take <bexco2010@gmail.com>, 2015
# Siegfried <iori3000@hanafos.com>, 2011
msgid ""
msgstr ""
"Project-Id-Version: Dolphin Emulator\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-26 22:32+0000\n"
"PO-Revision-Date: 2016-03-26 22:32+0000\n"
"Last-Translator: dolphinbot <delroth@dolphin-emu.org>\n"
"PO-Revision-Date: 2016-04-30 02:33+0000\n"
"Last-Translator: Siegfried <iori3000@hanafos.com>\n"
"Language-Team: Korean (http://www.transifex.com/delroth/dolphin-emu/language/"
"ko/)\n"
"Language: ko\n"
@ -29,7 +30,7 @@ msgid ""
"This software should not be used to play games you do not legally own.\n"
msgstr ""
"\n"
"돌핀은 무료 및 오픈 소스인 게임큐브와 Wii 에뮬레이터입니다.\n"
"돌핀은 오픈 소스이자 무료인 게임큐브 및 Wii 에뮬레이터입니다.\n"
"\n"
"이 소프트웨어는 합법적 소유가 아닌 게임을 플레이할 때 쓰여져서는 안됩니다.\n"
@ -2157,6 +2158,11 @@ msgid ""
"\n"
"If unsure, select 1x."
msgstr ""
"비등방성 필터링을 켭니다.\n"
"비스듬한 보기 각도에 있는 텍스처들의 보이는 품질을 향상시킵니다.\n"
"소수 게임에서 이슈들을 일으킬지도 모릅니다.\n"
"\n"
"모르겠으면, 1x를 선택하세요."
#: Source/Core/DolphinWX/ISOProperties.cpp:333
msgid ""
@ -2673,6 +2679,11 @@ msgid ""
"\n"
"If unsure, leave this unchecked."
msgstr ""
"모든 텍스처를 필터합니다, 필터되지 않도록 명시적 설정된 게임도 포함합니다.\n"
"일부 게임에서 특정 텍스처 품질을 향상시킬지도 모릅니다, 하지만 다른 게임에서 "
"이슈를 일으킬 것입니다.\n"
"\n"
"잘 모르겠으면, 체크 해제해 두세요."
#: Source/Core/DolphinWX/FifoPlayerDlg.cpp:248
msgid "Find next"
@ -3821,7 +3832,7 @@ msgstr "메인 스틱"
#: Source/Core/DolphinWX/GameListCtrl.cpp:272
#: Source/Core/DolphinWX/FrameTools.cpp:349
msgid "Maker"
msgstr "만든이"
msgstr "제작사"
#: Source/Core/DolphinWX/ISOProperties.cpp:467
msgid "Maker ID:"

View file

@ -9,9 +9,9 @@
# Felipefpl, 2015
# Felipefpl, 2015
# Felipefpl, 2015-2016
# Gonçalo Matos, 2015
# Gonçalo Matos, 2015
# Runo <i.am.runo@gmail.com>, 2013
# igorruckert <igorruckert@yahoo.com.br>, 2015
# igorruckert <igorruckert@yahoo.com.br>, 2015-2016
# Charles Fernando da Silva <eu.charles@hotmail.com>, 2013
# Mateus B. Cassiano <jhonn.copperfield@gmail.com>, 2013-2015
# Mateus B. Cassiano <jhonn.copperfield@gmail.com>, 2013
@ -21,8 +21,8 @@ msgstr ""
"Project-Id-Version: Dolphin Emulator\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-26 22:32+0000\n"
"PO-Revision-Date: 2016-03-26 22:32+0000\n"
"Last-Translator: dolphinbot <delroth@dolphin-emu.org>\n"
"PO-Revision-Date: 2016-03-27 12:22+0000\n"
"Last-Translator: Felipefpl\n"
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/delroth/dolphin-"
"emu/language/pt_BR/)\n"
"Language: pt_BR\n"
@ -2098,7 +2098,7 @@ msgid ""
"If unsure, check virtual XFB emulation instead."
msgstr ""
"Emula os XFBs precisamente.\n"
"A emulação fica muito lenta e proíbe a renderização de alta resolução mas é "
"Desacelera muito a emulação e proíbe a renderização de alta resolução mas é "
"necessário pra emular um número de jogos apropriadamente.\n"
"\n"
"Se não tiver certeza, selecione a emulação virtual do XFB ao invés disto."
@ -2191,6 +2191,12 @@ msgid ""
"\n"
"If unsure, select 1x."
msgstr ""
"Ativa a filtragem anisotrópica.\n"
"Melhora a qualidade visual das texturas que estão nos ângulos de "
"visualização oblíquos.\n"
"Poderia causar problemas em um pequeno número de jogos. \n"
"\n"
"Se não tiver certeza, selecione 1x."
#: Source/Core/DolphinWX/ISOProperties.cpp:333
msgid ""
@ -2225,7 +2231,7 @@ msgid ""
"If unsure, leave this unchecked."
msgstr ""
"Ative isto se você quer usar a janela principal do Dolphin pra renderização "
"ao invés de uma janela separada.\n"
"ao invés de uma janela de renderização separada.\n"
"\n"
"Se não tiver certeza, deixe isto desmarcado."
@ -2708,6 +2714,12 @@ msgid ""
"\n"
"If unsure, leave this unchecked."
msgstr ""
"Filtra todas as texturas, incluindo qualquer textura que o jogo definiu "
"explicitamente como não filtrada.\n"
"Pode melhorar a qualidade de certas texturas em alguns jogos mas causará "
"problemas em outros.\n"
"\n"
"Se não tiver certeza, deixe isto desmarcado."
#: Source/Core/DolphinWX/FifoPlayerDlg.cpp:248
msgid "Find next"
@ -3026,7 +3038,7 @@ msgstr "Adaptador do GameCube pra Wii U"
#: Source/Core/DolphinWX/ControllerConfigDiag.cpp:509
#: Source/Core/DolphinWX/ControllerConfigDiag.cpp:519
msgid "GameCube Controller Configuration"
msgstr "Configuração de Controle do GameCube"
msgstr "Configuração do Controle do GameCube"
#: Source/Core/DolphinWX/ControllerConfigDiag.cpp:75
msgid "GameCube Controllers"
@ -3992,7 +4004,7 @@ msgid ""
"If unsure, leave this unchecked."
msgstr ""
"Modifica as texturas pra mostrar o formato no qual elas estão codificadas. "
"Precisa resetar a emulação na maioria dos casos.\n"
"Precisa de um reset da emulação na maioria dos casos.\n"
"\n"
"Se não tiver certeza, deixe isto desmarcado."
@ -4255,7 +4267,7 @@ msgstr "Eixo do nunchuk"
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:431
msgid "Nvidia 3D Vision"
msgstr "3D Vision da Nvidia"
msgstr "Visão em 3D da Nvidia"
#: Source/Core/DolphinWX/FifoPlayerDlg.cpp:598
#, c-format
@ -6232,7 +6244,7 @@ msgstr ""
"Causa problemas em alguns jogos, mas pode dar uma aceleração decente "
"dependendo do jogo e/ou da sua GPU.\n"
"\n"
"Se não tiver certeza, deixe isto desmarcado."
"Se não tiver certeza, deixe isto selecionado."
#: Source/Core/DolphinWX/ISOProperties.cpp:366
msgid "Use a single depth buffer for both eyes. Needed for a few games."

View file

@ -3,8 +3,8 @@
# This file is distributed under the same license as the Dolphin Emulator package.
#
# Translators:
# Alexander Zhukov <cyb3rm4n@gmail.com>, 2014-2015
# Anton Guts <BFG1992@mail.ru>, 2015
# Сайб <cyb3rm4n@gmail.com>, 2014-2015
# Anton Guts <BFG1992@mail.ru>, 2015-2016
# dffggff <nanoposan69@gmail.com>, 2013
# dffggff <nanoposan69@gmail.com>, 2013
# flashmozzg <flashmozzg@gmail.com>, 2014-2015
@ -16,8 +16,8 @@ msgstr ""
"Project-Id-Version: Dolphin Emulator\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-26 22:32+0000\n"
"PO-Revision-Date: 2016-03-26 22:32+0000\n"
"Last-Translator: dolphinbot <delroth@dolphin-emu.org>\n"
"PO-Revision-Date: 2016-04-10 07:54+0000\n"
"Last-Translator: Anton Guts <BFG1992@mail.ru>\n"
"Language-Team: Russian (http://www.transifex.com/delroth/dolphin-emu/"
"language/ru/)\n"
"Language: ru\n"
@ -1788,7 +1788,7 @@ msgstr "Отключить эмуляцию bounding box"
#: Source/Core/Core/HotkeyManager.cpp:53
msgid "Disable Emulation Speed Limit"
msgstr "Отключить ограничение скорости эмуляции."
msgstr "Отключить ограничение скорости эмуляции"
#: Source/Core/DolphinWX/VideoConfigDiag.cpp:417
msgid "Disable Fog"
@ -2176,6 +2176,12 @@ msgid ""
"\n"
"If unsure, select 1x."
msgstr ""
"Включает анизотропную фильтрацию.\n"
"Повышает визуальное качество текстур, находящихся под наклонными углами "
"обзора.\n"
"В некоторых играх возможны проблемы.\n"
"\n"
"Если не уверены выберите 1x."
#: Source/Core/DolphinWX/ISOProperties.cpp:333
msgid ""
@ -2696,6 +2702,11 @@ msgid ""
"\n"
"If unsure, leave this unchecked."
msgstr ""
"Фильтровать все текстуры, включая заданные игрой как нефильтруемые.\n"
"Может улучшить качество определенных текстур в некоторых играх, но вызвать "
"проблемы в других.\n"
"\n"
"Если не уверены оставьте выключенным."
#: Source/Core/DolphinWX/FifoPlayerDlg.cpp:248
msgid "Find next"
@ -4628,11 +4639,11 @@ msgstr ""
"Уменьшает ступенчатость при растеризации 3D-графики. Сглаживает зубчатые "
"края у объектов.\n"
"Увеличивает нагрузку на ГП и иногда вызывает графические дефекты. SSAA "
"значительно более требовательный по сравнению с MSAA, но выполняет "
"высококачественное сглаживание объектов, а также применяет сглаживание к "
"значительно более требовательно по сравнению с MSAA, но выполняет "
"сглаживание геометрии наивысшего качества, применяя сглаживание также к "
"освещению, шейдерным эффектам и текстурам.\n"
"\n"
"Если не уверены, выберите Отсутствует."
"Если не уверены выберите Отсутствует."
#: Source/Core/DolphinWX/ControllerConfigDiag.cpp:256
#: Source/Core/DolphinWX/InputConfigDiag.cpp:1005
@ -5470,13 +5481,13 @@ msgid ""
"\n"
"If unsure, select Native."
msgstr ""
"Указывает разрешение рендеринга. Высокое разрешение сильно улучшает качество "
"картинки, но также сильно увеличивает нагрузку на ГП и вызывает проблемы в "
"некоторых играх.\n"
"\"Кратное 640x528\" даст размер больше, чем \"По размеру окна\", но вызовет "
"меньше проблем. Основное правило: чем ниже внутреннее разрешение, тем лучше "
"производительность. Автоматически (По размеру окна), 1.5x и 2.5x могут "
"вызвать проблемы в некоторых играх.\n"
"Указывает разрешение рендеринга. Высокое разрешение значительно улучшает "
"качество картинки, но также значительно увеличивает нагрузку на ГП и "
"вызывает проблемы в некоторых играх.\n"
"\"Кратное 640x528\" даст размер чуть больше, чем \"По размеру окна\", но "
"вызовет меньше проблем. Основное правило: чем ниже внутреннее разрешение, "
"тем лучше производительность. Автоматически (По размеру окна), 1.5x и 2.5x "
"могут вызвать проблемы в некоторых играх.\n"
"\n"
"Если не уверены выберите Родное."

View file

@ -13,8 +13,8 @@ msgstr ""
"Project-Id-Version: Dolphin Emulator\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-26 22:32+0000\n"
"PO-Revision-Date: 2016-03-26 22:32+0000\n"
"Last-Translator: dolphinbot <delroth@dolphin-emu.org>\n"
"PO-Revision-Date: 2016-03-26 22:36+0000\n"
"Last-Translator: JosJuice\n"
"Language-Team: Swedish (http://www.transifex.com/delroth/dolphin-emu/"
"language/sv/)\n"
"Language: sv\n"
@ -2173,6 +2173,12 @@ msgid ""
"\n"
"If unsure, select 1x."
msgstr ""
"Aktiverar anisotropisk filtrering.\n"
"Förbättrar den visuella kvalitén för texturer som ligger i indirekta "
"visningsvinklar.\n"
"Kan orsaka fel i ett fåtal spel.\n"
"\n"
"Om du är osäker kan du välja 1x."
#: Source/Core/DolphinWX/ISOProperties.cpp:333
msgid ""
@ -2693,6 +2699,12 @@ msgid ""
"\n"
"If unsure, leave this unchecked."
msgstr ""
"Filtrerar alla texturer, även de som spel specifikt markerar som "
"ofiltrerade.\n"
"Kan förbättra kvalitén av vissa texturer i några spel, men kan leda till "
"problem i andra spel.\n"
"\n"
"Om du är osäker kan du lämna detta omarkerat."
#: Source/Core/DolphinWX/FifoPlayerDlg.cpp:248
msgid "Find next"

View file

@ -16,8 +16,8 @@ msgstr ""
"Project-Id-Version: Dolphin Emulator\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-26 22:32+0000\n"
"PO-Revision-Date: 2016-03-26 22:32+0000\n"
"Last-Translator: dolphinbot <delroth@dolphin-emu.org>\n"
"PO-Revision-Date: 2016-03-27 10:31+0000\n"
"Last-Translator: 天绝星 <c.cejhb@gmail.com>\n"
"Language-Team: Chinese (China) (http://www.transifex.com/delroth/dolphin-emu/"
"language/zh_CN/)\n"
"Language: zh_CN\n"
@ -2141,6 +2141,11 @@ msgid ""
"\n"
"If unsure, select 1x."
msgstr ""
"启用各向异性过滤。\n"
"增强倾斜视角下纹理的视觉质量。\n"
"在少部分游戏中可能造成问题。\n"
"\n"
"如果不确定请选择“1x”。"
#: Source/Core/DolphinWX/ISOProperties.cpp:333
msgid ""
@ -2644,6 +2649,11 @@ msgid ""
"\n"
"If unsure, leave this unchecked."
msgstr ""
"过滤所有纹理,包括游戏已明确设定为不过滤的。\n"
"可能提升一些游戏的某些纹理质量,但会导致另一些游戏\n"
"出现问题。\n"
"\n"
"如果不确定,请不要勾选此项。"
#: Source/Core/DolphinWX/FifoPlayerDlg.cpp:248
msgid "Find next"

View file

@ -530,6 +530,8 @@ FSTEntry ScanDirectoryTree(const std::string& directory, bool recursive)
bool DeleteDirRecursively(const std::string& directory)
{
INFO_LOG(COMMON, "DeleteDirRecursively: %s", directory.c_str());
bool success = true;
#ifdef _WIN32
// Find the first file in the directory.
WIN32_FIND_DATA ffd;
@ -568,22 +570,16 @@ bool DeleteDirRecursively(const std::string& directory)
{
if (!DeleteDirRecursively(newPath))
{
#ifndef _WIN32
closedir(dirp);
#endif
return false;
success = false;
break;
}
}
else
{
if (!File::Delete(newPath))
{
#ifndef _WIN32
closedir(dirp);
#endif
return false;
success = false;
break;
}
}
@ -594,9 +590,10 @@ bool DeleteDirRecursively(const std::string& directory)
}
closedir(dirp);
#endif
File::DeleteDir(directory);
if (success)
File::DeleteDir(directory);
return true;
return success;
}
// Create directory and copy contents (does not overwrite existing files)
@ -792,7 +789,6 @@ static void RebuildUserDirectories(unsigned int dir_index)
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;
@ -851,7 +847,6 @@ static void RebuildUserDirectories(unsigned int dir_index)
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_PPSHADERSPRESETS_IDX] = s_user_paths[D_LOAD_IDX] + PPS_PRESETS_DIR DIR_SEP;
break;
}
}

View file

@ -11,7 +11,6 @@ protected:
constexpr NonCopyable() = default;
~NonCopyable() = default;
private:
NonCopyable(NonCopyable&) = delete;
NonCopyable& operator=(NonCopyable&) = delete;
NonCopyable(const NonCopyable&) = delete;
NonCopyable& operator=(const NonCopyable&) = delete;
};

View file

@ -449,6 +449,11 @@ void Advance()
}
PowerPC::ppcState.downcount = CyclesToDowncount(g_slicelength);
// Check for any external exceptions.
// It's important to do this after processing events otherwise any exceptions will be delayed until the next slice:
// Pokemon Box refuses to boot if the first exception from the audio DMA is received late
PowerPC::CheckExternalExceptions();
}
void LogPendingEvents()

View file

@ -67,7 +67,7 @@ static void Reset()
code_flags.fill(0);
}
static void AnalyzeRange(int start_addr, int end_addr)
static void AnalyzeRange(u16 start_addr, u16 end_addr)
{
// First we run an extremely simplified version of a disassembler to find
// where all instructions start.
@ -75,7 +75,7 @@ static void AnalyzeRange(int start_addr, int end_addr)
// This may not be 100% accurate in case of jump tables!
// It could get desynced, which would be bad. We'll see if that's an issue.
u16 last_arithmetic = 0;
for (int addr = start_addr; addr < end_addr;)
for (u16 addr = start_addr; addr < end_addr;)
{
UDSPInstruction inst = dsp_imem_read(addr);
const DSPOPCTemplate *opcode = GetOpTemplate(inst);
@ -97,7 +97,7 @@ static void AnalyzeRange(int start_addr, int end_addr)
{
// LOOP, LOOPI
code_flags[addr] |= CODE_LOOP_START;
code_flags[addr + 1] |= CODE_LOOP_END;
code_flags[static_cast<u16>(addr + 1u)] |= CODE_LOOP_END;
}
// Mark the last arithmetic/multiplier instruction before a branch.
@ -122,7 +122,7 @@ static void AnalyzeRange(int start_addr, int end_addr)
opcode->opcode == 0x2000 ||
opcode->extended
)
code_flags[addr + opcode->size] |= CODE_CHECK_INT;
code_flags[static_cast<u16>(addr + opcode->size)] |= CODE_CHECK_INT;
addr += opcode->size;
}
@ -130,7 +130,7 @@ static void AnalyzeRange(int start_addr, int end_addr)
// Next, we'll scan for potential idle skips.
for (int s = 0; s < NUM_IDLE_SIGS; s++)
{
for (int addr = start_addr; addr < end_addr; addr++)
for (u16 addr = start_addr; addr < end_addr; addr++)
{
bool found = false;
for (int i = 0; i < MAX_IDLE_SIG_SIZE + 1; i++)

View file

@ -243,7 +243,7 @@ void DSPEmitter::Compile(u16 start_addr)
// Handle loop condition, only if current instruction was flagged as a loop destination
// by the analyzer.
if (DSPAnalyzer::code_flags[compilePC-1] & DSPAnalyzer::CODE_LOOP_END)
if (DSPAnalyzer::code_flags[static_cast<u16>(compilePC - 1u)] & DSPAnalyzer::CODE_LOOP_END)
{
MOVZX(32, 16, EAX, M(&(g_dsp.r.st[2])));
TEST(32, R(EAX), R(EAX));

View file

@ -76,7 +76,7 @@ void Step()
u16 opc = dsp_fetch_code();
ExecuteInstruction(UDSPInstruction(opc));
if (DSPAnalyzer::code_flags[g_dsp.pc - 1] & DSPAnalyzer::CODE_LOOP_END)
if (DSPAnalyzer::code_flags[static_cast<u16>(g_dsp.pc - 1u)] & DSPAnalyzer::CODE_LOOP_END)
HandleLoop();
}

View file

@ -8,6 +8,7 @@
#include "Common/MsgHandler.h"
#include "Common/Logging/Log.h"
#include "Core/ConfigManager.h"
#include "Core/HW/GCPad.h"
#include "Core/HW/SI_DeviceGCAdapter.h"
#include "InputCommon/GCAdapter.h"
@ -32,125 +33,11 @@ GCPadStatus CSIDevice_GCAdapter::GetPadStatus()
return PadStatus;
}
int CSIDevice_GCAdapter::RunBuffer(u8* _pBuffer, int _iLength)
void CSIDevice_GCController::Rumble(u8 numPad, ControlState strength)
{
// For debug logging only
ISIDevice::RunBuffer(_pBuffer, _iLength);
// Read the command
EBufferCommands command = static_cast<EBufferCommands>(_pBuffer[3]);
const u8 numPAD = NetPlay_InGamePadToLocalPad(ISIDevice::m_iDeviceNumber);
if (numPAD < 4)
{
if (!GCAdapter::DeviceConnected(numPAD))
{
reinterpret_cast<u32*>(_pBuffer)[0] = SI_NONE;
return 4;
}
}
// Handle it
switch (command)
{
case CMD_RESET:
case CMD_ID:
*(u32*)&_pBuffer[0] = SI_GC_CONTROLLER;
break;
case CMD_DIRECT:
{
INFO_LOG(SERIALINTERFACE, "PAD - Direct (Length: %d)", _iLength);
u32 high, low;
GetData(high, low);
for (int i = 0; i < (_iLength - 1) / 2; i++)
{
_pBuffer[i + 0] = (high >> (i * 8)) & 0xff;
_pBuffer[i + 4] = (low >> (i * 8)) & 0xff;
}
}
break;
case CMD_ORIGIN:
{
INFO_LOG(SERIALINTERFACE, "PAD - Get Origin");
Calibrate();
u8* pCalibration = reinterpret_cast<u8*>(&m_Origin);
for (int i = 0; i < (int)sizeof(SOrigin); i++)
{
_pBuffer[i ^ 3] = *pCalibration++;
}
}
break;
// Recalibrate (FiRES: i am not 100 percent sure about this)
case CMD_RECALIBRATE:
{
INFO_LOG(SERIALINTERFACE, "PAD - Recalibrate");
Calibrate();
u8* pCalibration = reinterpret_cast<u8*>(&m_Origin);
for (int i = 0; i < (int)sizeof(SOrigin); i++)
{
_pBuffer[i ^ 3] = *pCalibration++;
}
}
break;
// DEFAULT
default:
{
ERROR_LOG(SERIALINTERFACE, "Unknown SI command (0x%x)", command);
PanicAlert("SI: Unknown command (0x%x)", command);
}
break;
}
return _iLength;
SIDevices device = SConfig::GetInstance().m_SIDevice[numPad];
if (device == SIDEVICE_WIIU_ADAPTER)
GCAdapter::Output(numPad, static_cast<u8>(strength));
else if (SIDevice_IsGCController(device))
Pad::Rumble(numPad, strength);
}
void CSIDevice_GCAdapter::SendCommand(u32 _Cmd, u8 _Poll)
{
UCommand command(_Cmd);
switch (command.Command)
{
// Costis sent it in some demos :)
case 0x00:
break;
case CMD_WRITE:
{
unsigned int uType = command.Parameter1; // 0 = stop, 1 = rumble, 2 = stop hard
unsigned int uStrength = command.Parameter2;
// get the correct pad number that should rumble locally when using netplay
const u8 numPAD = NetPlay_InGamePadToLocalPad(ISIDevice::m_iDeviceNumber);
if (numPAD < 4)
{
if (uType == 1 && uStrength > 2)
GCAdapter::Output(numPAD, 1);
else
GCAdapter::Output(numPAD, 0);
}
if (!_Poll)
{
m_Mode = command.Parameter2;
INFO_LOG(SERIALINTERFACE, "PAD %i set to mode %i", ISIDevice::m_iDeviceNumber, m_Mode);
}
}
break;
default:
{
ERROR_LOG(SERIALINTERFACE, "Unknown direct command (0x%x)", _Cmd);
PanicAlert("SI: Unknown direct command");
}
break;
}
}

View file

@ -14,6 +14,4 @@ public:
CSIDevice_GCAdapter(SIDevices device, int _iDeviceNumber);
GCPadStatus GetPadStatus() override;
int RunBuffer(u8* _pBuffer, int _iLength) override;
void SendCommand(u32 _Cmd, u8 _Poll) override;
};

View file

@ -290,9 +290,9 @@ void CSIDevice_GCController::SendCommand(u32 _Cmd, u8 _Poll)
if (numPAD < 4)
{
if (uType == 1 && uStrength > 2)
Pad::Rumble(numPAD, 1.0);
CSIDevice_GCController::Rumble(numPAD, 1.0);
else
Pad::Rumble(numPAD, 0.0);
CSIDevice_GCController::Rumble(numPAD, 0.0);
}
if (!_Poll)

View file

@ -4,6 +4,7 @@
#pragma once
#include "Core/HW/GCPad.h"
#include "Core/HW/SI_Device.h"
#include "InputCommon/GCPadStatus.h"
@ -107,6 +108,9 @@ public:
static bool NetPlay_GetInput(u8 numPAD, GCPadStatus* status);
static u8 NetPlay_InGamePadToLocalPad(u8 numPAD);
// Direct rumble to the right GC Controller
static void Rumble(u8 numPad, ControlState strength);
protected:
void Calibrate();
void HandleMoviePadStatus(GCPadStatus* PadStatus);

View file

@ -279,6 +279,13 @@ void DoState(PointerWrap &p)
p.Do(reply_queue);
p.Do(last_reply_time);
if (p.GetMode() == PointerWrap::MODE_READ)
{
// We need to make sure all file handles are closed so WII_IPC_Devices_fs::DoState can successfully re-create /tmp
for (u32 i = 0; i < IPC_MAX_FDS; i++)
g_FdMap[i].reset();
}
for (const auto& entry : g_DeviceMap)
{
if (entry.second->IsHardware())
@ -289,7 +296,7 @@ void DoState(PointerWrap &p)
if (p.GetMode() == PointerWrap::MODE_READ)
{
for (u32 i=0; i<IPC_MAX_FDS; i++)
for (u32 i=0; i < IPC_MAX_FDS; i++)
{
u32 exists = 0;
p.Do(exists);
@ -309,13 +316,9 @@ void DoState(PointerWrap &p)
g_FdMap[i]->DoState(p);
}
}
else
{
g_FdMap[i].reset();
}
}
for (u32 i=0; i<ES_MAX_COUNT; i++)
for (u32 i=0; i < ES_MAX_COUNT; i++)
{
p.Do(es_inuse[i]);
u32 handleID = es_handles[i]->GetDeviceID();
@ -346,7 +349,7 @@ void DoState(PointerWrap &p)
}
}
for (u32 i=0; i<ES_MAX_COUNT; i++)
for (u32 i=0; i < ES_MAX_COUNT; i++)
{
p.Do(es_inuse[i]);
u32 handleID = es_handles[i]->GetDeviceID();

View file

@ -44,7 +44,6 @@ static std::mutex cs_frameSkip;
namespace Movie {
static bool s_bFrameStep = false;
static bool s_bFrameStop = false;
static bool s_bReadOnly = true;
static u32 s_rerecords = 0;
static PlayMode s_playMode = MODE_NONE;
@ -160,11 +159,6 @@ void FrameUpdate()
s_bFrameStep = false;
}
// ("framestop") the only purpose of this is to cause interpreter/jit Run() to return temporarily.
// after that we set it back to CPU_RUNNING and continue as normal.
if (s_bFrameStop)
*PowerPC::GetStatePtr() = PowerPC::CPU_STEPPING;
if (s_framesToSkip)
FrameSkipping();
@ -177,7 +171,6 @@ void Init()
{
s_bPolled = false;
s_bFrameStep = false;
s_bFrameStop = false;
s_bSaveConfig = false;
s_iCPUCore = SConfig::GetInstance().iCPUCore;
if (IsPlayingInput())
@ -264,11 +257,6 @@ void DoFrameStep()
}
}
void SetFrameStopping(bool bEnabled)
{
s_bFrameStop = bEnabled;
}
void SetReadOnly(bool bEnabled)
{
if (s_bReadOnly != bEnabled)

View file

@ -153,7 +153,6 @@ void ChangePads(bool instantly = false);
void ChangeWiiPads(bool instantly = false);
void DoFrameStep();
void SetFrameStopping(bool bEnabled);
void SetReadOnly(bool bEnabled);
void SetFrameSkipping(unsigned int framesToSkip);

View file

@ -76,7 +76,6 @@ void CachedInterpreter::SingleStep()
static void EndBlock(UGeckoInstruction data)
{
PC = NPC;
PowerPC::CheckExceptions();
PowerPC::ppcState.downcount -= data.hex;
if (PowerPC::ppcState.downcount <= 0)
{

View file

@ -278,12 +278,6 @@ void Interpreter::Run()
}
CoreTiming::Advance();
if (PowerPC::ppcState.Exceptions)
{
PowerPC::CheckExceptions();
PC = NPC;
}
}
// Let the waiting thread know we are done leaving

View file

@ -202,16 +202,12 @@ void Jit64AsmRoutineManager::Generate()
SetJumpTarget(bail);
doTiming = GetCodePtr();
// Test external exceptions.
TEST(32, PPCSTATE(Exceptions), Imm32(EXCEPTION_EXTERNAL_INT | EXCEPTION_PERFORMANCE_MONITOR | EXCEPTION_DECREMENTER));
FixupBranch noExtException = J_CC(CC_Z);
// make sure npc contains the next pc (needed for exception checking in CoreTiming::Advance)
MOV(32, R(RSCRATCH), PPCSTATE(pc));
MOV(32, PPCSTATE(npc), R(RSCRATCH));
ABI_PushRegistersAndAdjustStack({}, 0);
ABI_CallFunction(reinterpret_cast<void *>(&PowerPC::CheckExternalExceptions));
ABI_PopRegistersAndAdjustStack({}, 0);
SetJumpTarget(noExtException);
// Check the state pointer to see if we are exiting
// Gets checked on at the end of every slice
TEST(32, M(PowerPC::GetStatePtr()), Imm32(0xFFFFFFFF));
J_CC(CC_Z, outerLoop);

View file

@ -73,21 +73,18 @@ void JitArm64AsmRoutineManager::Generate()
SetJumpTarget(bail);
doTiming = GetCodePtr();
// Write the current PC out to PPCSTATE
STR(INDEX_UNSIGNED, DISPATCHER_PC, PPC_REG, PPCSTATE_OFF(pc));
STR(INDEX_UNSIGNED, DISPATCHER_PC, PPC_REG, PPCSTATE_OFF(npc));
MOVI2R(X30, (u64)&CoreTiming::Advance);
BLR(X30);
// Does exception checking
LDR(INDEX_UNSIGNED, W0, PPC_REG, PPCSTATE_OFF(Exceptions));
FixupBranch no_exceptions = CBZ(W0);
STR(INDEX_UNSIGNED, DISPATCHER_PC, PPC_REG, PPCSTATE_OFF(pc));
STR(INDEX_UNSIGNED, DISPATCHER_PC, PPC_REG, PPCSTATE_OFF(npc));
MOVI2R(X30, (u64)&PowerPC::CheckExceptions);
BLR(X30);
LDR(INDEX_UNSIGNED, DISPATCHER_PC, PPC_REG, PPCSTATE_OFF(npc));
SetJumpTarget(no_exceptions);
// Load the PC back into DISPATCHER_PC (the exception handler might have changed it)
LDR(INDEX_UNSIGNED, DISPATCHER_PC, PPC_REG, PPCSTATE_OFF(pc));
// Check the state pointer to see if we are exiting
// Gets checked on every exception check
// Gets checked on at the end of every slice
MOVI2R(X0, (u64)PowerPC::GetStatePtr());
LDR(INDEX_UNSIGNED, W0, X0, 0);

View file

@ -225,7 +225,7 @@ CPUState GetState()
return state;
}
volatile CPUState *GetStatePtr()
const volatile CPUState *GetStatePtr()
{
return &state;
}

View file

@ -160,7 +160,7 @@ void Pause();
void Stop();
void FinishStateMove();
CPUState GetState();
volatile CPUState *GetStatePtr(); // this oddity is here instead of an extern declaration to easily be able to find all direct accesses throughout the code.
const volatile CPUState *GetStatePtr(); // this oddity is here instead of an extern declaration to easily be able to find all direct accesses throughout the code.
u32 CompactCR();
void ExpandCR(u32 cr);

View file

@ -2,8 +2,8 @@
// Licensed under GPLv2+
// Refer to the license.txt file included.
#include <algorithm>
#include <cstddef>
#include <cstring>
#include <limits>
#include <memory>
#include <string>
@ -22,87 +22,156 @@
namespace DiscIO
{
// Provides caching and split-operation-to-block-operations facilities.
// Used for compressed blob reading and direct drive reading.
void SectorReader::SetSectorSize(int blocksize)
{
m_block_size = std::max(blocksize, 0);
for (auto& cache_entry : m_cache)
cache_entry.resize(blocksize);
{
cache_entry.Reset();
cache_entry.data.resize(m_chunk_blocks * m_block_size);
}
}
m_cache_tags.fill(std::numeric_limits<u64>::max());
m_blocksize = blocksize;
void SectorReader::SetChunkSize(int block_cnt)
{
m_chunk_blocks = std::max(block_cnt, 1);
// Clear cache and resize the data arrays
SetSectorSize(m_block_size);
}
SectorReader::~SectorReader()
{
}
const std::vector<u8>& SectorReader::GetBlockData(u64 block_num)
const SectorReader::Cache* SectorReader::FindCacheLine(u64 block_num)
{
// TODO : Expand usage of the cache to more than one block :P
if (m_cache_tags[0] == block_num)
return m_cache[0];
auto itr = std::find_if(m_cache.begin(), m_cache.end(), [&](const Cache& entry)
{
return entry.Contains(block_num);
});
if (itr == m_cache.end())
return nullptr;
GetBlock(block_num, m_cache[0].data());
m_cache_tags[0] = block_num;
return m_cache[0];
itr->MarkUsed();
return &*itr;
}
SectorReader::Cache* SectorReader::GetEmptyCacheLine()
{
Cache* oldest = &m_cache[0];
// Find the Least Recently Used cache line to replace.
for (auto& cache_entry : m_cache)
{
if (cache_entry.IsLessRecentlyUsedThan(*oldest))
oldest = &cache_entry;
cache_entry.ShiftLRU();
}
oldest->Reset();
return oldest;
}
const SectorReader::Cache* SectorReader::GetCacheLine(u64 block_num)
{
if (auto entry = FindCacheLine(block_num))
return entry;
// Cache miss. Fault in the missing entry.
Cache* cache = GetEmptyCacheLine();
// We only read aligned chunks, this avoids duplicate overlapping entries.
u64 chunk_idx = block_num / m_chunk_blocks;
u32 blocks_read = ReadChunk(cache->data.data(), chunk_idx);
if (!blocks_read)
return nullptr;
cache->Fill(chunk_idx * m_chunk_blocks, blocks_read);
// Secondary check for out-of-bounds read.
// If we got less than m_chunk_blocks, we may still have missed.
// We do this after the cache fill since the cache line itself is
// fine, the problem is being asked to read past the end of the disk.
return cache->Contains(block_num) ? cache : nullptr;
}
bool SectorReader::Read(u64 offset, u64 size, u8* out_ptr)
{
u64 startingBlock = offset / m_blocksize;
u64 remain = size;
int positionInBlock = (int)(offset % m_blocksize);
u64 block = startingBlock;
u64 block = 0;
u32 position_in_block = static_cast<u32>(offset % m_block_size);
while (remain > 0)
{
// Check if we are ready to do a large block read. > instead of >= so we don't bother if remain is only one block.
if (positionInBlock == 0 && remain > (u64)m_blocksize)
{
u64 num_blocks = remain / m_blocksize;
ReadMultipleAlignedBlocks(block, num_blocks, out_ptr);
block += num_blocks;
out_ptr += num_blocks * m_blocksize;
remain -= num_blocks * m_blocksize;
continue;
}
block = offset / m_block_size;
const std::vector<u8>& data = GetBlockData(block);
const Cache* cache = GetCacheLine(block);
if (!cache)
return false;
u32 to_copy = m_blocksize - positionInBlock;
if (to_copy >= remain)
{
// Yay, we are done!
std::copy(data.begin() + positionInBlock, data.begin() + positionInBlock + remain, out_ptr);
return true;
}
else
{
std::copy(data.begin() + positionInBlock, data.begin() + positionInBlock + to_copy, out_ptr);
out_ptr += to_copy;
remain -= to_copy;
positionInBlock = 0;
block++;
}
// Cache entries are aligned chunks, we may not want to read from the start
u32 read_offset = static_cast<u32>(block - cache->block_idx) * m_block_size + position_in_block;
u32 can_read = m_block_size * cache->num_blocks - read_offset;
u32 was_read = static_cast<u32>(std::min<u64>(can_read, remain));
std::copy(cache->data.begin() + read_offset,
cache->data.begin() + read_offset + was_read,
out_ptr);
offset += was_read;
out_ptr += was_read;
remain -= was_read;
position_in_block = 0;
}
return true;
}
bool SectorReader::ReadMultipleAlignedBlocks(u64 block_num, u64 num_blocks, u8* out_ptr)
// Crap default implementation if not overridden.
bool SectorReader::ReadMultipleAlignedBlocks(u64 block_num, u64 cnt_blocks, u8* out_ptr)
{
for (u64 i = 0; i < num_blocks; i++)
for (u64 i = 0; i < cnt_blocks; ++i)
{
const std::vector<u8>& data = GetBlockData(block_num + i);
const u64 offset = i * m_blocksize;
if (!GetBlock(block_num + i, out_ptr))
return false;
out_ptr += m_block_size;
}
return true;
}
std::copy(data.begin(), data.end(), out_ptr + offset);
u32 SectorReader::ReadChunk(u8* buffer, u64 chunk_num)
{
u64 block_num = chunk_num * m_chunk_blocks;
u32 cnt_blocks = m_chunk_blocks;
// If we are reading the end of a disk, there may not be enough blocks to
// read a whole chunk. We need to clamp down in that case.
u64 end_block = GetDataSize() / m_block_size;
if (end_block)
cnt_blocks = static_cast<u32>(std::min<u64>(m_chunk_blocks, end_block - block_num));
if (ReadMultipleAlignedBlocks(block_num, cnt_blocks, buffer))
{
if (cnt_blocks < m_chunk_blocks)
{
std::fill(buffer + cnt_blocks * m_block_size,
buffer + m_chunk_blocks * m_block_size,
0u);
}
return cnt_blocks;
}
return true;
// end_block may be zero on real disks if we fail to get the media size.
// We have to fallback to probing the disk instead.
if (!end_block)
{
for (u32 i = 0; i < cnt_blocks; ++i)
{
if (!GetBlock(block_num + i, buffer))
{
std::fill(buffer, buffer + (cnt_blocks - i) * m_block_size, 0u);
return i;
}
buffer += m_block_size;
}
return cnt_blocks;
}
return 0;
}
std::unique_ptr<IBlobReader> CreateBlobReader(const std::string& filename)

View file

@ -50,32 +50,112 @@ protected:
};
// Provides caching and split-operation-to-block-operations facilities.
// Used for compressed blob reading and direct drive reading.
// Currently only uses a single entry cache.
// Multi-block reads are not cached.
// Provides caching and byte-operation-to-block-operations facilities.
// Used for compressed blob and direct drive reading.
// NOTE: GetDataSize() is expected to be evenly divisible by the sector size.
class SectorReader : public IBlobReader
{
public:
virtual ~SectorReader();
virtual ~SectorReader() = 0;
bool Read(u64 offset, u64 size, u8 *out_ptr) override;
friend class DriveReader;
bool Read(u64 offset, u64 size, u8* out_ptr) override;
protected:
void SetSectorSize(int blocksize);
virtual void GetBlock(u64 block_num, u8 *out) = 0;
// This one is uncached. The default implementation is to simply call GetBlockData multiple times and memcpy.
virtual bool ReadMultipleAlignedBlocks(u64 block_num, u64 num_blocks, u8 *out_ptr);
int GetSectorSize() const
{
return m_block_size;
}
// Set the chunk size -> the number of blocks to read at a time.
// Default value is 1 but that is too low for physical devices
// like CDROMs. Setting this to a higher value helps reduce seeking
// and IO overhead by batching reads. Do not set it too high either
// as large reads are slow and will take too long to resolve.
void SetChunkSize(int blocks);
int GetChunkSize() const
{
return m_chunk_blocks;
}
// Read a single block/sector.
virtual bool GetBlock(u64 block_num, u8* out) = 0;
// Read multiple contiguous blocks.
// Default implementation just calls GetBlock in a loop, it should be
// overridden in derived classes where possible.
virtual bool ReadMultipleAlignedBlocks(u64 block_num, u64 num_blocks, u8* out_ptr);
private:
// A reference returned by GetBlockData is invalidated as soon as GetBlockData, Read, or ReadMultipleAlignedBlocks is called again.
const std::vector<u8>& GetBlockData(u64 block_num);
struct Cache
{
std::vector<u8> data;
u64 block_idx = 0;
u32 num_blocks = 0;
enum { CACHE_SIZE = 32 };
int m_blocksize;
std::array<std::vector<u8>, CACHE_SIZE> m_cache;
std::array<u64, CACHE_SIZE> m_cache_tags;
// [Pseudo-] Least Recently Used Shift Register
// When an empty cache line is needed, the line with the lowest value
// is taken and reset; the LRU register is then shifted down 1 place
// on all lines (low bit discarded). When a line is used, the high bit
// is set marking it as most recently used.
u32 lru_sreg = 0;
void Reset()
{
block_idx = 0;
num_blocks = 0;
lru_sreg = 0;
}
void Fill(u64 block, u32 count)
{
block_idx = block;
num_blocks = count;
// NOTE: Setting only the high bit means the newest line will
// be selected for eviction if every line in the cache was
// touched. This gives MRU behavior which is probably
// desirable in that case.
MarkUsed();
}
bool Contains(u64 block) const
{
return block >= block_idx && block - block_idx < num_blocks;
}
void MarkUsed()
{
lru_sreg |= 0x80000000;
}
void ShiftLRU()
{
lru_sreg >>= 1;
}
bool IsLessRecentlyUsedThan(const Cache& other) const
{
return lru_sreg < other.lru_sreg;
}
};
// Gets the cache line that contains the given block, or nullptr.
// NOTE: The cache record only lasts until it expires (next GetEmptyCacheLine)
const Cache* FindCacheLine(u64 block_num);
// Finds the least recently used cache line, resets and returns it.
Cache* GetEmptyCacheLine();
// Combines FindCacheLine with GetEmptyCacheLine and ReadChunk.
// Always returns a valid cache line (loading the data if needed).
// May return nullptr only if the cache missed and the read failed.
const Cache* GetCacheLine(u64 block_num);
// Read all bytes from a chunk of blocks into a buffer.
// Returns the number of blocks read (may be less than m_chunk_blocks
// if chunk_num is the last chunk on the disk and the disk size is not
// evenly divisible into chunks). Returns zero if it fails.
u32 ReadChunk(u8* buffer, u64 chunk_num);
static constexpr int CACHE_LINES = 32;
u32 m_block_size = 0; // Bytes in a sector/block
u32 m_chunk_blocks = 1; // Number of sectors/blocks in a chunk
std::array<Cache, CACHE_LINES> m_cache;
};
class CBlobBigEndianReader

View file

@ -79,7 +79,7 @@ u64 CompressedBlobReader::GetBlockCompressedSize(u64 block_num) const
return 0;
}
void CompressedBlobReader::GetBlock(u64 block_num, u8 *out_ptr)
bool CompressedBlobReader::GetBlock(u64 block_num, u8 *out_ptr)
{
bool uncompressed = false;
u32 comp_block_size = (u32)GetBlockCompressedSize(block_num);
@ -97,7 +97,13 @@ void CompressedBlobReader::GetBlock(u64 block_num, u8 *out_ptr)
memset(&m_zlib_buffer[comp_block_size], 0, m_zlib_buffer.size() - comp_block_size);
m_file.Seek(offset, SEEK_SET);
m_file.ReadBytes(m_zlib_buffer.data(), comp_block_size);
if (!m_file.ReadBytes(m_zlib_buffer.data(), comp_block_size))
{
PanicAlertT("The disc image \"%s\" is truncated, some of the data is missing.",
m_file_name.c_str());
m_file.Clear();
return false;
}
// First, check hash.
u32 block_hash = HashAdler32(m_zlib_buffer.data(), comp_block_size);
@ -133,8 +139,12 @@ void CompressedBlobReader::GetBlock(u64 block_num, u8 *out_ptr)
}
inflateEnd(&z);
if (uncomp_size != m_header.block_size)
{
PanicAlert("Wrong block size");
return false;
}
}
return true;
}
bool CompressFileToBlob(const std::string& infile, const std::string& outfile, u32 sub_type,

View file

@ -55,7 +55,7 @@ public:
u64 GetDataSize() const override { return m_header.data_size; }
u64 GetRawSize() const override { return m_file_size; }
u64 GetBlockCompressedSize(u64 block_num) const;
void GetBlock(u64 block_num, u8* out_ptr) override;
bool GetBlock(u64 block_num, u8* out_ptr) override;
private:
CompressedBlobReader(const std::string& filename);

View file

@ -18,6 +18,16 @@
#ifdef _WIN32
#include "Common/StringUtil.h"
#else
#include <sys/ioctl.h>
#include <stdio.h> // fileno
#if defined __linux__
#include <linux/fs.h> // BLKGETSIZE64
#elif defined __FreeBSD__
#include <sys/disk.h> // DIOCGMEDIASIZE
#elif defined __APPLE__
#include <sys/disk.h> // DKIOCGETBLOCKCOUNT / DKIOCGETBLOCKSIZE
#endif
#endif
namespace DiscIO
@ -25,24 +35,39 @@ namespace DiscIO
DriveReader::DriveReader(const std::string& drive)
{
// 32 sectors is roughly the optimal amount a CD Drive can read in
// a single IO cycle. Larger values yield no performance improvement
// and just cause IO stalls from the read delay. Smaller values allow
// the OS IO and seeking overhead to ourstrip the time actually spent
// transferring bytes from the media.
SetChunkSize(32); // 32*2048 = 64KiB
SetSectorSize(2048);
#ifdef _WIN32
SectorReader::SetSectorSize(2048);
auto const path = UTF8ToTStr(std::string("\\\\.\\") + drive);
m_disc_handle = CreateFile(path.c_str(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
nullptr, OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, nullptr);
if (m_disc_handle != INVALID_HANDLE_VALUE)
if (IsOK())
{
// Do a test read to make sure everything is OK, since it seems you can get
// handles to empty drives.
DWORD not_used;
std::vector<u8> buffer(m_blocksize);
if (!ReadFile(m_disc_handle, buffer.data(), m_blocksize, &not_used, nullptr))
std::vector<u8> buffer(GetSectorSize());
if (!ReadFile(m_disc_handle, buffer.data(), GetSectorSize(), &not_used, nullptr))
{
// OK, something is wrong.
CloseHandle(m_disc_handle);
m_disc_handle = INVALID_HANDLE_VALUE;
return;
}
}
if (IsOK())
{
// Initialize m_size by querying the volume capacity.
STORAGE_READ_CAPACITY storage_size;
storage_size.Version = sizeof(storage_size);
DWORD bytes = 0;
DeviceIoControl(m_disc_handle, IOCTL_STORAGE_READ_CAPACITY, nullptr, 0,
&storage_size, sizeof(storage_size), &bytes, nullptr);
m_size = bytes ? storage_size.DiskLength.QuadPart : 0;
#ifdef _LOCKDRIVE // Do we want to lock the drive?
// Lock the compact disc in the CD-ROM drive to prevent accidental
@ -53,10 +78,24 @@ DriveReader::DriveReader(const std::string& drive)
0, &dwNotUsed, nullptr);
#endif
#else
SectorReader::SetSectorSize(2048);
m_file.Open(drive, "rb");
if (m_file)
{
int fd = fileno(m_file.GetHandle());
#if defined __linux__
// NOTE: Doesn't matter if it fails, m_size was initialized to zero
ioctl(fd, BLKGETSIZE64, &m_size); // u64*
#elif defined __FreeBSD__
off_t size = 0;
ioctl(fd, DIOCGMEDIASIZE, &size); // off_t*
m_size = size;
#elif defined __APPLE__
u64 count = 0;
u32 block_size = 0;
ioctl(fd, DKIOCGETBLOCKCOUNT, &count); // u64*
ioctl(fd, DKIOCGETBLOCKSIZE, &block_size); // u32*
m_size = count * block_size;
#endif
#endif
}
else
@ -95,45 +134,32 @@ std::unique_ptr<DriveReader> DriveReader::Create(const std::string& drive)
return reader;
}
void DriveReader::GetBlock(u64 block_num, u8* out_ptr)
bool DriveReader::GetBlock(u64 block_num, u8* out_ptr)
{
std::vector<u8> sector(m_blocksize);
#ifdef _WIN32
u64 offset = m_blocksize * block_num;
LONG off_low = (LONG)offset & 0xFFFFFFFF;
LONG off_high = (LONG)(offset >> 32);
DWORD not_used;
SetFilePointer(m_disc_handle, off_low, &off_high, FILE_BEGIN);
if (!ReadFile(m_disc_handle, sector.data(), m_blocksize, &not_used, nullptr))
PanicAlertT("Disc Read Error");
#else
m_file.Seek(m_blocksize * block_num, SEEK_SET);
m_file.ReadBytes(sector.data(), m_blocksize);
#endif
std::copy(sector.begin(), sector.end(), out_ptr);
return DriveReader::ReadMultipleAlignedBlocks(block_num, 1, out_ptr);
}
bool DriveReader::ReadMultipleAlignedBlocks(u64 block_num, u64 num_blocks, u8* out_ptr)
{
#ifdef _WIN32
u64 offset = m_blocksize * block_num;
LONG off_low = (LONG)offset & 0xFFFFFFFF;
LONG off_high = (LONG)(offset >> 32);
DWORD not_used;
SetFilePointer(m_disc_handle, off_low, &off_high, FILE_BEGIN);
if (!ReadFile(m_disc_handle, out_ptr, (DWORD)(m_blocksize * num_blocks), &not_used, nullptr))
LARGE_INTEGER offset;
offset.QuadPart = GetSectorSize() * block_num;
SetFilePointerEx(m_disc_handle, offset, nullptr, FILE_BEGIN);
DWORD bytes_read;
if (!ReadFile(m_disc_handle, out_ptr, static_cast<DWORD>(GetSectorSize() * num_blocks),
&bytes_read, nullptr))
{
PanicAlertT("Disc Read Error");
return false;
}
return bytes_read == GetSectorSize() * num_blocks;
#else
fseeko(m_file.GetHandle(), (m_blocksize * block_num), SEEK_SET);
if (fread(out_ptr, 1, (m_blocksize * num_blocks), m_file.GetHandle()) != (m_blocksize * num_blocks))
return false;
m_file.Seek(GetSectorSize() * block_num, SEEK_SET);
if (m_file.ReadBytes(out_ptr, num_blocks * GetSectorSize()))
return true;
m_file.Clear();
return false;
#endif
return true;
}
} // namespace

View file

@ -30,18 +30,18 @@ public:
private:
DriveReader(const std::string& drive);
void GetBlock(u64 block_num, u8 *out_ptr) override;
bool GetBlock(u64 block_num, u8 *out_ptr) override;
bool ReadMultipleAlignedBlocks(u64 block_num, u64 num_blocks, u8* out_ptr) override;
#ifdef _WIN32
HANDLE m_disc_handle;
HANDLE m_disc_handle = INVALID_HANDLE_VALUE;
PREVENT_MEDIA_REMOVAL m_lock_cdrom;
bool IsOK() { return m_disc_handle != INVALID_HANDLE_VALUE; }
bool IsOK() const { return m_disc_handle != INVALID_HANDLE_VALUE; }
#else
File::IOFile m_file;
bool IsOK() { return m_file != nullptr; }
bool IsOK() const { return m_file.IsOpen() && m_file.IsGood(); }
#endif
s64 m_size;
u64 m_size = 0;
};
} // namespace

View file

@ -4,6 +4,7 @@
#include <algorithm>
#include <cinttypes>
#include <cmath>
#include <cstddef>
#include <cstdio>
#include <cstring>
@ -345,24 +346,22 @@ void CGameListCtrl::Update()
SetFocus();
}
static wxString NiceSizeFormat(u64 _size)
static wxString NiceSizeFormat(u64 size)
{
// Return a pretty filesize string from byte count.
// e.g. 1134278 -> "1.08 MiB"
const char* const unit_symbols[] = {"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"};
const char* const unit_symbols[] = { "B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB" };
// Find largest power of 2 less than _size.
// div 10 to get largest named unit less than _size
// Find largest power of 2 less than size.
// div 10 to get largest named unit less than size
// 10 == log2(1024) (number of B in a KiB, KiB in a MiB, etc)
const u64 unit = IntLog2(std::max<u64>(_size, 1)) / 10;
const u64 unit_size = (1ull << (unit * 10));
// Max value is 63 / 10 = 6
const int unit = IntLog2(std::max<u64>(size, 1)) / 10;
// mul 1000 for 3 decimal places, add 5 to round up, div 10 for 2 decimal places
std::string value = std::to_string((_size * 1000 / unit_size + 5) / 10);
// Insert decimal point.
value.insert(value.size() - 2, ".");
return StrToWxStr(StringFromFormat("%s %s", value.c_str(), unit_symbols[unit]));
// Don't need exact values, only 5 most significant digits
double unit_size = std::pow(2, unit * 10);
return wxString::Format("%.2f %s", size / unit_size, unit_symbols[unit]);
}
// Update the column content of the item at _Index

View file

@ -1506,8 +1506,11 @@ void CISOProperties::ChangeBannerDetails(DiscIO::IVolume::ELanguage language)
m_Comment->SetValue(comment);
m_Maker->SetValue(maker);//dev too
std::string filename, extension;
SplitPath(OpenGameListItem.GetFileName(), nullptr, &filename, &extension);
std::string path, filename, extension;
SplitPath(OpenGameListItem.GetFileName(), &path, &filename, &extension);
// Real disk drives don't have filenames on Windows
if (filename.empty() && extension.empty())
filename = path + ' ';
// Also sets the window's title
SetTitle(StrToWxStr(StringFromFormat("%s%s: %s - ", filename.c_str(),
extension.c_str(), OpenGameListItem.GetUniqueID().c_str())) + name);