Shouldn't this be spelled "kernel" not "kernal"?
Jake
On 01/06/2017 03:03 PM, Jörg Raftopoulos wrote:
Now without fstream as requested.
--- src/decoder/plugins/SidplayDecoderPlugin.cxx.old 2017-01-06
20:11:07.563104617 +0100
+++ src/decoder/plugins/SidplayDecoderPlugin.cxx 2017-01-06
20:10:00.090405449 +0100
@@ -61,6 +61,33 @@
static bool filter_setting;
+static const char* kernal_path;
+static const char* basic_path;
+static const char* chargen_path;
+
+/*
+ * Load ROM dump from file.
+ * Allocate the buffer if file exists, otherwise return 0.
+ */
+static char* loadRom(const char* path, size_t romSize)
+{
+ char* buffer = 0;
+ FILE *rom;
+ rom = fopen(path, "rb");
+ if (rom)
+ {
+ buffer = new char[romSize];
+ fread(buffer, romSize, 1, rom);
+ fclose(rom);
+ }
+ else
+ {
+ FormatError(sidplay_domain,
+ "unable to load rom dump %s", path);
+ }
+ return buffer;
+}
+
static SidDatabase *
sidplay_load_songlength_db(const Path path)
{
@@ -96,6 +123,9 @@
filter_setting = block.GetBlockValue("filter", true);
+ kernal_path = block.GetBlockValue("kernal");
+ basic_path = block.GetBlockValue("basic");
+ chargen_path = block.GetBlockValue("chargen");
return true;
}
@@ -198,6 +228,18 @@
#ifdef HAVE_SIDPLAYFP
sidplayfp player;
+
+ /* Load ROM files */
+ char *kernal = loadRom(kernal_path, 8192);
+ char *basic = loadRom(basic_path, 8192);
+ char *chargen = loadRom(chargen_path, 4096);
+
+ player.setRoms((const uint8_t*)kernal, (const uint8_t*)basic,
+ (const uint8_t*)chargen);
+
+ delete [] kernal;
+ delete [] basic;
+ delete [] chargen;
#else
sidplay2 player;
#endif
--- doc/user.xml.old 2017-01-04 19:03:35.837522837 +0100
+++ doc/user.xml 2017-01-06 20:45:35.296669517 +0100
@@ -2431,6 +2431,8 @@
<para>
C64 SID decoder based on
+ <ulink url="https://sourceforge.net/projects/sidplay-residfp/">
+ <application>libsidplayfp</application></ulink> or
<application>libsidplay</application>.
</para>
@@ -2478,6 +2480,42 @@
Turns the SID filter emulation on or off.
</entry>
</row>
+
+ <row>
+ <entry>
+ <varname>kernal</varname>
+ <parameter>PATH</parameter>
+ </entry>
+ <entry>
+ Only libsidplayfp. Some SID tunes require rom images
+ to play. C64 rom dumps are included in Frodo or VICE
+ emulation software tarballs. Absolute path to kernal
+ rom image file.
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <varname>basic</varname>
+ <parameter>PATH</parameter>
+ </entry>
+ <entry>
+ Only libsidplayfp. Absolute path to basic rom image
+ file.
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <varname>chargen</varname>
+ <parameter>PATH</parameter>
+ </entry>
+ <entry>
+ Only libsidplayfp. Absolute path to chargen rom image
+ file.
+ </entry>
+ </row>
+
</tbody>
</tgroup>
</informaltable>
Max Kellermann <m...@duempel.org> hat am 3. Januar 2017 um 10:58 geschrieben:
On 2017/01/03 10:55, Jörg Raftopoulos <jo...@raftopoulos.net> wrote:
Darn webmailer. Patch attached as a zip file.
But... what is it? No description, no documentation.
Oh, and please don't use iostreams. It's a bloated mess.
_______________________________________________
mpd-devel mailing list
mpd-devel@musicpd.org
http://mailman.blarg.de/listinfo/mpd-devel
_______________________________________________
mpd-devel mailing list
mpd-devel@musicpd.org
http://mailman.blarg.de/listinfo/mpd-devel