Browse code

Update snes9x code from 1.53 to 1.6.0.

Notable differences from upstream:
* Did not use the same #include setup for the new byuu apu and instead chose to do things more traditionally, as the latter is also much easier to deal with in Visual Studio than just including .cpp files into other .cpp files...
* MSU1 support not included (I see no need for this in a plugin meant to be used for original SNES music).
* The dynamic rate control on the APU not included (I also see no need for it in this plugin).
* The extra resamplers I added in were removed as the original hermite resampler was folded into a single non-inhertiable resampler.
* Bits of cleanup.

Naram Qashat authored on 2021/04/19 21:20:36
Showing 1 changed files
... ...
@@ -3,10 +3,6 @@
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4 4
  *
5 5
  * Partially based on the vio*sf framework
6
- *
7
- * NOTE: 16-bit sound is always enabled, the player is currently limited to
8
- * creating a 16-bit PCM for Winamp and can not handle 8-bit sound from
9
- * snes9x.
10 6
  */
11 7
 
12 8
 #pragma once
... ...
@@ -23,12 +19,13 @@ class XSFPlayer;
23 19
 class XSFConfig_SNSF : public XSFConfig
24 20
 {
25 21
 protected:
26
-	static constexpr bool /*initSixteenBitSound = true, */initReverseStereo = false;
27
-	static constexpr unsigned initResampler = 1;
22
+	static constexpr bool initSeparateEchoBuffer = false;
23
+	static constexpr unsigned initInterpolation = 2;
28 24
 	inline static const std::string initMutes = "00000000";
29 25
 
30 26
 	friend class XSFConfig;
31
-	bool /*sixteenBitSound, */reverseStereo;
27
+	bool separateEchoBuffer;
28
+	unsigned interpolation;
32 29
 	std::bitset<8> mutes;
33 30
 
34 31
 	XSFConfig_SNSF();
... ...
@@ -39,8 +36,6 @@ protected:
39 36
 	void SaveSpecificConfigDialog(XSFConfigDialog *dialog) override;
40 37
 	void CopySpecificConfigToMemory(XSFPlayer *xSFPlayer, bool preLoad) override;
41 38
 public:
42
-	unsigned resampler;
43
-
44 39
 	void About(HWND parent) override;
45 40
 	XSFConfigDialog *CreateDialogBox(wxWindow *window, const std::string &title) override;
46 41
 };
Browse code

Add wxWidgets-based configuration dialog boxes.

* Removes the configuration dialog boxes that used my DialogBuilder.
* Move default configuration values to be inlined within the headers.
* Moved 2SF's and GSF's XSFConfig classes to their own headers to accommodate the new wxWidgets dialog boxes.
* Make it so NCSF's SoundView dialog can be toggled on or off from the configuration dialog box.

Naram Qashat authored on 2021/04/04 12:46:14
Showing 1 changed files
... ...
@@ -16,14 +16,16 @@
16 16
 #include "windowsh_wrapper.h"
17 17
 #include "XSFConfig.h"
18 18
 
19
+class wxWindow;
20
+class XSFConfigDialog;
19 21
 class XSFPlayer;
20 22
 
21 23
 class XSFConfig_SNSF : public XSFConfig
22 24
 {
23 25
 protected:
24
-	static bool /*initSixteenBitSound, */initReverseStereo;
25
-	static unsigned initResampler;
26
-	static std::string initMutes;
26
+	static constexpr bool /*initSixteenBitSound = true, */initReverseStereo = false;
27
+	static constexpr unsigned initResampler = 1;
28
+	inline static const std::string initMutes = "00000000";
27 29
 
28 30
 	friend class XSFConfig;
29 31
 	bool /*sixteenBitSound, */reverseStereo;
... ...
@@ -32,13 +34,13 @@ protected:
32 34
 	XSFConfig_SNSF();
33 35
 	void LoadSpecificConfig() override;
34 36
 	void SaveSpecificConfig() override;
35
-	void GenerateSpecificDialogs() override;
36
-	INT_PTR CALLBACK ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) override;
37
-	void ResetSpecificConfigDefaults(HWND hwndDlg) override;
38
-	void SaveSpecificConfigDialog(HWND hwndDlg) override;
37
+	void InitializeSpecificConfigDialog(XSFConfigDialog *dialog) override;
38
+	void ResetSpecificConfigDefaults(XSFConfigDialog *dialog) override;
39
+	void SaveSpecificConfigDialog(XSFConfigDialog *dialog) override;
39 40
 	void CopySpecificConfigToMemory(XSFPlayer *xSFPlayer, bool preLoad) override;
40 41
 public:
41 42
 	unsigned resampler;
42 43
 
43 44
 	void About(HWND parent) override;
45
+	XSFConfigDialog *CreateDialogBox(wxWindow *window, const std::string &title) override;
44 46
 };
Browse code

Add override keyword.

Naram Qashat authored on 2021/03/30 01:29:32
Showing 1 changed files
... ...
@@ -30,15 +30,15 @@ protected:
30 30
 	std::bitset<8> mutes;
31 31
 
32 32
 	XSFConfig_SNSF();
33
-	void LoadSpecificConfig();
34
-	void SaveSpecificConfig();
35
-	void GenerateSpecificDialogs();
36
-	INT_PTR CALLBACK ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
37
-	void ResetSpecificConfigDefaults(HWND hwndDlg);
38
-	void SaveSpecificConfigDialog(HWND hwndDlg);
39
-	void CopySpecificConfigToMemory(XSFPlayer *xSFPlayer, bool preLoad);
33
+	void LoadSpecificConfig() override;
34
+	void SaveSpecificConfig() override;
35
+	void GenerateSpecificDialogs() override;
36
+	INT_PTR CALLBACK ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) override;
37
+	void ResetSpecificConfigDefaults(HWND hwndDlg) override;
38
+	void SaveSpecificConfigDialog(HWND hwndDlg) override;
39
+	void CopySpecificConfigToMemory(XSFPlayer *xSFPlayer, bool preLoad) override;
40 40
 public:
41 41
 	unsigned resampler;
42 42
 
43
-	void About(HWND parent);
43
+	void About(HWND parent) override;
44 44
 };
Browse code

Various changes:

* Use enum class instead of enum (except for the enums for the resource IDs, not really necessary there).
* For NCSF specifically, included a function to convert an enum class to its underlying integral type (as this is needed for use with the std::bitset class).
* Cleanup headers so all the ones needed in a file are explicitly included even if they may possibly be included in another header.
* Used forward declarations in a few spots.
* Explicitly namespaced all (u)int*_t uses (this might seem like overkill, but it helps me see when the standard types are being used with a simple search for std::).
* Made sure it all builds with MinGW-w64 as well (both gcc and clang).
* Removed some std::move from DialogBuilder.cpp based on clang's warnings for that.
* Replaced use of std::copy_n on strings in DialogBuilder.cpp with my CopyToString functions that use wcscpy.
* Replaced CHAR_MIN/CHAR_MAX in eqstr.h and ltstr.h with std::numeric_limits<char>::min/max().

Naram Qashat authored on 2021/03/21 03:16:45
Showing 1 changed files
... ...
@@ -12,9 +12,12 @@
12 12
 #pragma once
13 13
 
14 14
 #include <bitset>
15
-#include "XSFPlayer.h"
15
+#include <string>
16
+#include "windowsh_wrapper.h"
16 17
 #include "XSFConfig.h"
17 18
 
19
+class XSFPlayer;
20
+
18 21
 class XSFConfig_SNSF : public XSFConfig
19 22
 {
20 23
 protected:
Browse code

Remove last modification date from files.

(I never remember to update these and besides, GitHub history can show when they were last modified.)

Naram Qashat authored on 2021/03/19 10:58:12
Showing 1 changed files
... ...
@@ -1,7 +1,6 @@
1 1
 /*
2 2
  * xSF - SNSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2014-09-24
5 4
  *
6 5
  * Partially based on the vio*sf framework
7 6
  *
Browse code

Lots of changes in regards to strings, as follows:

* Removed my custom String class, as well as removed the really old
Unicode ConvertUTF, the UTF Converter, and the UTF Encode/Decode
functions.
* Replaced the above with using standard C++ std::wstring_convert and
std::codecvt_utf8.
* Added headers adapted from llvm's libc++ project for allowing the
above C++ classes to exist with GCC and Clang when libc++ isn't being
used.
* Used std::string over std::wstring whenever possible.
* Added header adapted from llvm's libc++ project to create special
versions of the ifstream and ofstream classes that would utilize _wfopen
on non-MSVC Windows compilers, so those compilers could access files on
Windows that use characters outside the current codepage.
* Removed the -static-libgcc and -static-libstdc++ flags from the
Makefile for non-MSVC builds. The generated DLLs will require extra DLLs
from either Cygwin or MinGW (whichever is used to compile), I've only
tested with MinGW and for some reason they crash Winamp on exit, I have
no idea why.

Naram Qashat authored on 2014/09/24 13:58:55
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - SNSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2014-09-08
4
+ * Last modification on 2014-09-24
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  *
... ...
@@ -21,7 +21,7 @@ class XSFConfig_SNSF : public XSFConfig
21 21
 protected:
22 22
 	static bool /*initSixteenBitSound, */initReverseStereo;
23 23
 	static unsigned initResampler;
24
-	static std::wstring initMutes;
24
+	static std::string initMutes;
25 25
 
26 26
 	friend class XSFConfig;
27 27
 	bool /*sixteenBitSound, */reverseStereo;
Browse code

Use #pragma once instead of include guards.

Naram Qashat authored on 2014/09/08 14:47:36
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - SNSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2013-03-21
4
+ * Last modification on 2014-09-08
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  *
... ...
@@ -10,8 +10,7 @@
10 10
  * snes9x.
11 11
  */
12 12
 
13
-#ifndef XSFCONFIG_SNSF_H
14
-#define XSFCONFIG_SNSF_H
13
+#pragma once
15 14
 
16 15
 #include <bitset>
17 16
 #include "XSFPlayer.h"
... ...
@@ -41,5 +40,3 @@ public:
41 40
 
42 41
 	void About(HWND parent);
43 42
 };
44
-
45
-#endif
Browse code

Import actual code.

Naram Qashat authored on 2013/03/26 02:41:19
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,45 @@
1
+/*
2
+ * xSF - SNSF configuration
3
+ * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
+ * Last modification on 2013-03-21
5
+ *
6
+ * Partially based on the vio*sf framework
7
+ *
8
+ * NOTE: 16-bit sound is always enabled, the player is currently limited to
9
+ * creating a 16-bit PCM for Winamp and can not handle 8-bit sound from
10
+ * snes9x.
11
+ */
12
+
13
+#ifndef XSFCONFIG_SNSF_H
14
+#define XSFCONFIG_SNSF_H
15
+
16
+#include <bitset>
17
+#include "XSFPlayer.h"
18
+#include "XSFConfig.h"
19
+
20
+class XSFConfig_SNSF : public XSFConfig
21
+{
22
+protected:
23
+	static bool /*initSixteenBitSound, */initReverseStereo;
24
+	static unsigned initResampler;
25
+	static std::wstring initMutes;
26
+
27
+	friend class XSFConfig;
28
+	bool /*sixteenBitSound, */reverseStereo;
29
+	std::bitset<8> mutes;
30
+
31
+	XSFConfig_SNSF();
32
+	void LoadSpecificConfig();
33
+	void SaveSpecificConfig();
34
+	void GenerateSpecificDialogs();
35
+	INT_PTR CALLBACK ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
36
+	void ResetSpecificConfigDefaults(HWND hwndDlg);
37
+	void SaveSpecificConfigDialog(HWND hwndDlg);
38
+	void CopySpecificConfigToMemory(XSFPlayer *xSFPlayer, bool preLoad);
39
+public:
40
+	unsigned resampler;
41
+
42
+	void About(HWND parent);
43
+};
44
+
45
+#endif