Browse Source

Change OPL settings

The default OPL simulator is switched to the old dosbox simulation core for performance-quality balance. The new dosbox simulation core is renamed to 'DOSBOXNEW'.
Also, the text for one setting button is also changed.
louyihua 8 years ago
parent
commit
d10c87f95b

+ 3 - 1
global.c

@@ -156,7 +156,9 @@ PAL_LoadConfig(
 				}
 				case PALCFG_OPL:
 				{
-					if (SDL_strncasecmp(value.sValue, "DOSBOX", 6) == 0)
+					if (SDL_strncasecmp(value.sValue, "DOSBOXNEW", 9) == 0)
+						eOPLType = OPL_DOSBOX_NEW;
+					else if (SDL_strncasecmp(value.sValue, "DOSBOX", 6) == 0)
 						eOPLType = OPL_DOSBOX;
 					else if (SDL_strncasecmp(value.sValue, "MAME", 4) == 0)
 						eOPLType = OPL_MAME;

+ 2 - 1
global.h

@@ -562,7 +562,8 @@ typedef enum tagMUSICTYPE
 typedef enum tagOPLTYPE
 {
 	OPL_DOSBOX,
-	OPL_MAME
+	OPL_MAME,
+	OPL_DOSBOX_NEW,
 } OPLTYPE, *LPOPLTYPE;
 
 typedef struct tagGLOBALVARS

+ 10 - 0
rixplay.cpp

@@ -27,6 +27,7 @@
 
 #include "resampler.h"
 #include "adplug/opl.h"
+#include "adplug/demuopl.h"
 #include "adplug/dbemuopl.h"
 #include "adplug/emuopl.h"
 #include "adplug/surroundopl.h"
@@ -414,6 +415,12 @@ RIX_Init(
 		switch (gConfig.eOPLType)
 		{
 		case OPL_DOSBOX:
+			pRixPlayer->opl = new CSurroundopl(
+				new CDemuopl(gConfig.iOPLSampleRate, true, false),
+				new CDemuopl(gConfig.iOPLSampleRate, true, false),
+				true, gConfig.iOPLSampleRate, gConfig.iSurroundOPLOffset);
+			break;
+		case OPL_DOSBOX_NEW:
 			pRixPlayer->opl = new CSurroundopl(
 				new CDBemuopl(gConfig.iOPLSampleRate, true, false),
 				new CDBemuopl(gConfig.iOPLSampleRate, true, false),
@@ -432,6 +439,9 @@ RIX_Init(
 		switch (gConfig.eOPLType)
 		{
 		case OPL_DOSBOX:
+			pRixPlayer->opl = new CDemuopl(gConfig.iOPLSampleRate, true, gConfig.iAudioChannels == 2);
+			break;
+		case OPL_DOSBOX_NEW:
 			pRixPlayer->opl = new CDBemuopl(gConfig.iOPLSampleRate, true, gConfig.iAudioChannels == 2);
 			break;
 		case OPL_MAME:

+ 4 - 3
sdlpal.cfg.example

@@ -32,9 +32,10 @@
 #        'MP3' means use files named as 'xx.mp3' inside the 'mp3' directory.
 #MUSIC=RIX
 
-# OPL: Indicates which type of opl emulator to use. Valid types include 'DOSBOX'
-#      (default) and 'MAME'.  'DOSBOX' means use the opl emulator from dosbox
-#      project, while 'MAME' means use the opl emulator from M.A.M.E project.
+# OPL: Indicates which type of OPL emulator to use. Valid types include 'DOSBOX'
+#      (default), 'MAME' and 'DOSBOXNEW'. 'DOSBOXNEW' is the recommended OPL simulator
+#      on high-performance devices like PC or tablet. However, for lower-end phones,
+#      'DOSBOX' is the best choice for performance-quality balance.
 #OPL=DOSBOX
 
 # Stereo: Indicates whether to use mono audio or stereo audio. Non-zero means to use

+ 3 - 1
winrt/SDLPal.Common/MainPage.xaml

@@ -18,7 +18,7 @@
                 <TextBox x:Name="tbMsgFile" x:Uid="MessageFile" Header="自定义语言文件名" TextWrapping="Wrap" VerticalAlignment="Top" PlaceholderText="自定义语言文件名" IsReadOnly="True"/>
                 <StackPanel Orientation="Horizontal">
                     <Button x:Name="btnBrowseMsgFile" x:Uid="ButtonBrowseFile" Content="选择语言文件" Click="btnBrowseFile_Click" />
-                    <Button x:Name="btnClearMsgFile" x:Uid="ButtonClearFile" Content="清除语言文件" Margin="20,0,0,0" Click="btnClearFile_Click" />
+                    <Button x:Name="btnClearMsgFile" x:Uid="ButtonClearFile" Content="禁用语言文件" Margin="20,0,0,0" Click="btnClearFile_Click" />
                 </StackPanel>
                 <ToggleSwitch x:Name="tsTouchOverlay" x:Uid="TouchOverlay" Header="启用触屏辅助" OffContent="否" OnContent="是" />
                 <ToggleSwitch x:Name="tsKeepAspect" x:Uid="AspectRatio" Header="保持纵横比" OffContent="否" OnContent="是" />
@@ -35,6 +35,7 @@
                     <ComboBoxItem Content="1024"/>
                     <ComboBoxItem Content="2048"/>
                     <ComboBoxItem Content="4096"/>
+                    <ComboBoxItem Content="8192"/>
                 </ComboBox>
                 <ComboBox x:Name="cbCD" x:Uid="CD" Header="CD 音轨格式" PlaceholderText="CD 音轨格式">
                     <ComboBoxItem Content="MP3"/>
@@ -48,6 +49,7 @@
                 <ComboBox x:Name="cbOPL" x:Uid="OPL" Header="OPL 模拟器" PlaceholderText="OPL 模拟器">
                     <ComboBoxItem Content="DOSBOX"/>
                     <ComboBoxItem Content="MAME"/>
+                    <ComboBoxItem Content="DOSBOXNEW"/>
                 </ComboBox>
                 <ComboBox x:Name="cbOPLSR" x:Uid="OPLSR" Header="OPL 模拟器采样率" PlaceholderText="OPL 模拟器采样率">
                     <ComboBoxItem Content="12429"/>

+ 1 - 1
winrt/SDLPal.Common/Strings/en/Resources.resw

@@ -145,7 +145,7 @@
     <value>Select</value>
   </data>
   <data name="ButtonClearFile.Content" xml:space="preserve">
-    <value>Clear</value>
+    <value>Disable</value>
   </data>
   <data name="ButtonDefault.Content" xml:space="preserve">
     <value>Default setting</value>

+ 1 - 1
winrt/SDLPal.Common/Strings/zh-hans/Resources.resw

@@ -145,7 +145,7 @@
     <value>选择语言文件</value>
   </data>
   <data name="ButtonClearFile.Content" xml:space="preserve">
-    <value>清除语言文件</value>
+    <value>禁用语言文件</value>
   </data>
   <data name="ButtonDefault.Content" xml:space="preserve">
     <value>默认设置</value>

+ 1 - 1
winrt/SDLPal.Common/Strings/zh-hant/Resources.resw

@@ -145,7 +145,7 @@
     <value>選擇語言檔</value>
   </data>
   <data name="ButtonClearFile.Content" xml:space="preserve">
-    <value>清除語言檔</value>
+    <value>禁用語言檔</value>
   </data>
   <data name="ButtonDefault.Content" xml:space="preserve">
     <value>默認設定</value>