annotate src/xs_sidplay2.cc @ 695:ca594ca1056f

COM API support works now.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 22 May 2008 11:32:37 +0300
parents fd81a16434ed
children e2800b15ec0f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 /*
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 XMMS-SID - SIDPlay input plugin for X MultiMedia System (XMMS)
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 libSIDPlay v2 support
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5
324
dd201740a720 Changed copyright text.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
6 Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org>
539
d837d2f06456 Update copyright years.
Matti Hamalainen <ccr@tnsp.org>
parents: 528
diff changeset
7 (C) Copyright 1999-2007 Tecnic Software productions (TNSP)
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 This program is free software; you can redistribute it and/or modify
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 it under the terms of the GNU General Public License as published by
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 the Free Software Foundation; either version 2 of the License, or
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 (at your option) any later version.
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 This program is distributed in the hope that it will be useful,
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 GNU General Public License for more details.
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18
412
7f694e5a1493 Updated GNU GPL (new FSF address) and some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
19 You should have received a copy of the GNU General Public License along
7f694e5a1493 Updated GNU GPL (new FSF address) and some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
20 with this program; if not, write to the Free Software Foundation, Inc.,
7f694e5a1493 Updated GNU GPL (new FSF address) and some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
21 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 */
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 #include "xmms-sid.h"
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 #ifdef HAVE_SIDPLAY2
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26
460
9e683fb666ba Updates
Matti Hamalainen <ccr@tnsp.org>
parents: 445
diff changeset
27 #include <stdio.h>
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 #include "xs_sidplay2.h"
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 #include "xs_config.h"
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
30
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 #include <sidplay/sidplay2.h>
692
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
33 #ifdef HAVE_SIDPLAY2_COMI
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
34 # include <sidplay/sidlazyiptr.h>
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
35 #endif
694
fd81a16434ed Move builder header inclusions.
Matti Hamalainen <ccr@tnsp.org>
parents: 693
diff changeset
36
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37
695
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
38 class xs_sidplay2_t {
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
39 public:
692
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
40 #ifdef HAVE_SIDPLAY2_COMI
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
41 SidIPtr<ISidplay2> currEng;
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
42 SidLazyIPtr<ISidUnknown> currBuilder;
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
43 #else
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
44 sidplay2 *currEng;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
45 sidbuilder *currBuilder;
692
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
46 #endif
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
47 sid2_config_t currConfig;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
48 SidTune *currTune;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
49 guint8 *buf;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
50 size_t bufSize;
695
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
51
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
52 xs_sidplay2_t(void);
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
53 virtual ~xs_sidplay2_t(void) { ; }
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
54 };
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
55
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
56
694
fd81a16434ed Move builder header inclusions.
Matti Hamalainen <ccr@tnsp.org>
parents: 693
diff changeset
57 #ifdef HAVE_RESID_BUILDER
fd81a16434ed Move builder header inclusions.
Matti Hamalainen <ccr@tnsp.org>
parents: 693
diff changeset
58 # include <sidplay/builders/resid.h>
fd81a16434ed Move builder header inclusions.
Matti Hamalainen <ccr@tnsp.org>
parents: 693
diff changeset
59 #endif
fd81a16434ed Move builder header inclusions.
Matti Hamalainen <ccr@tnsp.org>
parents: 693
diff changeset
60 #ifdef HAVE_HARDSID_BUILDER
fd81a16434ed Move builder header inclusions.
Matti Hamalainen <ccr@tnsp.org>
parents: 693
diff changeset
61 # include <sidplay/builders/hardsid.h>
fd81a16434ed Move builder header inclusions.
Matti Hamalainen <ccr@tnsp.org>
parents: 693
diff changeset
62 #endif
fd81a16434ed Move builder header inclusions.
Matti Hamalainen <ccr@tnsp.org>
parents: 693
diff changeset
63
fd81a16434ed Move builder header inclusions.
Matti Hamalainen <ccr@tnsp.org>
parents: 693
diff changeset
64
695
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
65 xs_sidplay2_t::xs_sidplay2_t(void)
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
66 #ifdef HAVE_SIDPLAY2_COMI
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
67 :currEng(sidplay2::create())
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
68 #else
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
69 :currEng(NULL)
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
70 #endif
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
71 {
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
72 buf = NULL;
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
73 bufSize = 0;
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
74 currTune = NULL;
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
75 currBuilder = NULL;
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
76 }
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
77
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
78
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
79 /* We need to 'export' all this pseudo-C++ crap */
396
0a60ef2b5ab0 Cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 394
diff changeset
80 extern "C" {
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
81
75
653c9b0d1320 SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents: 74
diff changeset
82
467
9dafc55c4270 Beginnings of vfs portability.
Matti Hamalainen <ccr@tnsp.org>
parents: 460
diff changeset
83 /* Return song information
9dafc55c4270 Beginnings of vfs portability.
Matti Hamalainen <ccr@tnsp.org>
parents: 460
diff changeset
84 */
692
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
85 #define TFUNCTION xs_sidplay2_getinfo
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
86 #define TFUNCTION2 xs_sidplay2_updateinfo
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
87 #define TTUNEINFO SidTuneInfo
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
88 #define TTUNE SidTune
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
89 #define TENGINE xs_sidplay2_t
467
9dafc55c4270 Beginnings of vfs portability.
Matti Hamalainen <ccr@tnsp.org>
parents: 460
diff changeset
90 #include "xs_sidplay.h"
9dafc55c4270 Beginnings of vfs portability.
Matti Hamalainen <ccr@tnsp.org>
parents: 460
diff changeset
91
9dafc55c4270 Beginnings of vfs portability.
Matti Hamalainen <ccr@tnsp.org>
parents: 460
diff changeset
92
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
93 /* Check if we can play the given file
75
653c9b0d1320 SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents: 74
diff changeset
94 */
657
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 577
diff changeset
95 gboolean xs_sidplay2_probe(xs_file_t *f)
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
96 {
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
97 gchar tmpBuf[4];
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
98
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
99 if (!f) return FALSE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
100
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
101 if (xs_fread(tmpBuf, sizeof(gchar), 4, f) != 4)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
102 return FALSE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
103
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
104 if (!strncmp(tmpBuf, "PSID", 4) || !strncmp(tmpBuf, "RSID", 4))
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
105 return TRUE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
106 else
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
107 return FALSE;
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
108 }
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
109
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
110
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
111 /* Initialize SIDPlay2
75
653c9b0d1320 SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents: 74
diff changeset
112 */
657
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 577
diff changeset
113 gboolean xs_sidplay2_init(xs_status_t * myStatus)
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
114 {
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
115 gint tmpFreq, i;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
116 xs_sidplay2_t *myEngine;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
117 sid_filter_t tmpFilter;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
118 t_xs_sid2_filter *f;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
119 assert(myStatus);
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
120
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
121 /* Allocate internal structures */
695
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
122 myEngine = new xs_sidplay2_t();
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
123 myStatus->sidEngine = myEngine;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
124 if (!myEngine) return FALSE;
75
653c9b0d1320 SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents: 74
diff changeset
125
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
126 /* Initialize the engine */
695
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
127 #ifndef HAVE_SIDPLAY2_COMI
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
128 myEngine->currEng = new sidplay2;
692
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
129 #endif
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
130 if (!myEngine->currEng) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
131 xs_error("[SIDPlay2] Could not initialize emulation engine.\n");
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
132 return FALSE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
133 }
75
653c9b0d1320 SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents: 74
diff changeset
134
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
135 /* Get current configuration */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
136 myEngine->currConfig = myEngine->currEng->config();
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
137
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
138 /* Configure channels and stuff */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
139 switch (myStatus->audioChannels) {
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
140
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
141 case XS_CHN_AUTOPAN:
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
142 myEngine->currConfig.playback = sid2_stereo;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
143 break;
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
144
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
145 case XS_CHN_STEREO:
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
146 myEngine->currConfig.playback = sid2_stereo;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
147 break;
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
148
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
149 case XS_CHN_MONO:
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
150 default:
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
151 myEngine->currConfig.playback = sid2_mono;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
152 myStatus->audioChannels = XS_CHN_MONO;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
153 break;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
154 }
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
155
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
156
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
157 /* Memory mode settings */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
158 switch (xs_cfg.memoryMode) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
159 case XS_MPU_BANK_SWITCHING:
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
160 myEngine->currConfig.environment = sid2_envBS;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
161 break;
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
162
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
163 case XS_MPU_TRANSPARENT_ROM:
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
164 myEngine->currConfig.environment = sid2_envTP;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
165 break;
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
166
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
167 case XS_MPU_PLAYSID_ENVIRONMENT:
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
168 myEngine->currConfig.environment = sid2_envPS;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
169 break;
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
170
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
171 case XS_MPU_REAL:
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
172 default:
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
173 myEngine->currConfig.environment = sid2_envR;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
174 xs_cfg.memoryMode = XS_MPU_REAL;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
175 break;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
176 }
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
177
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
178
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
179 /* Audio parameters sanity checking and setup */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
180 myEngine->currConfig.precision = myStatus->audioBitsPerSample;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
181 tmpFreq = myStatus->audioFrequency;
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
182
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
183 if (myStatus->oversampleEnable)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
184 tmpFreq = (tmpFreq * myStatus->oversampleFactor);
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
185
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
186 myEngine->currConfig.frequency = tmpFreq;
74
8cb66a3f75f7 Testing
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
187
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
188 switch (myStatus->audioBitsPerSample) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
189 case XS_RES_8BIT:
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
190 myStatus->audioFormat = FMT_U8;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
191 myEngine->currConfig.sampleFormat = SID2_LITTLE_UNSIGNED;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
192 break;
127
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 103
diff changeset
193
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
194 case XS_RES_16BIT:
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
195 default:
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
196 switch (myStatus->audioFormat) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
197 case FMT_U16_LE:
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
198 myEngine->currConfig.sampleFormat = SID2_LITTLE_UNSIGNED;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
199 break;
127
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 103
diff changeset
200
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
201 case FMT_U16_BE:
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
202 myEngine->currConfig.sampleFormat = SID2_BIG_UNSIGNED;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
203 break;
127
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 103
diff changeset
204
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
205 case FMT_U16_NE:
657
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 577
diff changeset
206 #if G_BYTE_ORDER == G_BIG_ENDIAN
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
207 myEngine->currConfig.sampleFormat = SID2_BIG_UNSIGNED;
74
8cb66a3f75f7 Testing
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
208 #else
657
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 577
diff changeset
209 #if G_BYTE_ORDER == G_LITTLE_ENDIAN
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
210 myEngine->currConfig.sampleFormat = SID2_LITTLE_UNSIGNED;
657
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 577
diff changeset
211 #else
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 577
diff changeset
212 #error Unsupported endianess!
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 577
diff changeset
213 #endif
74
8cb66a3f75f7 Testing
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
214 #endif
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
215 break;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
216
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
217 case FMT_S16_LE:
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
218 myEngine->currConfig.sampleFormat = SID2_LITTLE_SIGNED;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
219 break;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
220
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
221 case FMT_S16_BE:
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
222 myEngine->currConfig.sampleFormat = SID2_BIG_SIGNED;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
223 break;
127
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 103
diff changeset
224
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
225 default:
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
226 myStatus->audioFormat = FMT_S16_NE;
657
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 577
diff changeset
227 #if G_BYTE_ORDER == G_BIG_ENDIAN
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
228 myEngine->currConfig.sampleFormat = SID2_BIG_SIGNED;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
229 #else
657
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 577
diff changeset
230 #if G_BYTE_ORDER == G_LITTLE_ENDIAN
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
231 myEngine->currConfig.sampleFormat = SID2_LITTLE_SIGNED;
657
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 577
diff changeset
232 #else
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 577
diff changeset
233 #error Unsupported endianess!
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 577
diff changeset
234 #endif
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
235 #endif
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
236 break;
127
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 103
diff changeset
237
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
238 }
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
239 break;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
240 }
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
241
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
242 /* Convert filter */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
243 f = &(xs_cfg.sid2Filter);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
244 XSDEBUG("using filter '%s', %d points\n", f->name, f->npoints);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
245 if (f->npoints > XS_SIDPLAY2_NFPOINTS) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
246 xs_error("[SIDPlay2] Invalid number of filter curve points (%d > %d)\n",
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
247 f->npoints, XS_SIDPLAY2_NFPOINTS);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
248 f->npoints = XS_SIDPLAY2_NFPOINTS;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
249 }
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
250
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
251 tmpFilter.points = f->npoints;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
252 for (i = 0; i < f->npoints; i++) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
253 tmpFilter.cutoff[i][0] = f->points[i].x;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
254 tmpFilter.cutoff[i][1] = f->points[i].y;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
255 }
352
2b4ca75b999f Cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
256
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
257 /* Initialize builder object */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
258 XSDEBUG("init builder #%i, maxsids=%i\n", xs_cfg.sid2Builder, (myEngine->currEng->info()).maxsids);
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
259 #ifdef HAVE_RESID_BUILDER
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
260 if (xs_cfg.sid2Builder == XS_BLD_RESID) {
692
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
261 #ifdef HAVE_SIDPLAY2_COMI
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
262 myEngine->currBuilder = ReSIDBuilderCreate("");
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
263 SidLazyIPtr<IReSIDBuilder> rs(myEngine->currBuilder);
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
264 if (rs) {
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
265 myEngine->currConfig.sidEmulation = rs->iaggregate();
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
266 #else
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
267 ReSIDBuilder *rs = new ReSIDBuilder("ReSID builder");
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
268 myEngine->currBuilder = (sidbuilder *) rs;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
269 if (rs) {
692
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
270 #endif
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
271 /* Builder object created, initialize it */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
272 rs->create((myEngine->currEng->info()).maxsids);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
273 if (!*rs) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
274 xs_error("reSID->create() failed.\n");
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
275 return FALSE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
276 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
277
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
278 rs->filter(xs_cfg.emulateFilters);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
279 if (!*rs) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
280 xs_error("reSID->filter(%d) failed.\n", xs_cfg.emulateFilters);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
281 return FALSE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
282 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
283
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
284 // FIXME FIX ME: support other configurable parameters ...
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
285 // ... WHEN/IF resid-builder+libsidplay2 gets fixed
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
286 rs->sampling(tmpFreq);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
287 if (!*rs) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
288 xs_error("reSID->sampling(%d) failed.\n", tmpFreq);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
289 return FALSE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
290 }
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
291
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
292 if (tmpFilter.points > 0)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
293 rs->filter((sid_filter_t *) &tmpFilter);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
294 else
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
295 rs->filter((sid_filter_t *) NULL);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
296
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
297 if (!*rs) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
298 xs_error("reSID->filter(NULL) failed.\n");
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
299 return FALSE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
300 }
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
301 }
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
302 }
321
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
303 #endif
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
304 #ifdef HAVE_HARDSID_BUILDER
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
305 if (xs_cfg.sid2Builder == XS_BLD_HARDSID) {
692
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
306 #ifdef HAVE_SIDPLAY2_COMI
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
307 myEngine->currBuilder = HardSIDBuilderCreate("");
693
56514f717cc3 Correct builder.
Matti Hamalainen <ccr@tnsp.org>
parents: 692
diff changeset
308 SidLazyIPtr<IHardSIDBuilder> hs(myEngine->currBuilder);
692
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
309 if (hs) {
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
310 myEngine->currConfig.sidEmulation = hs->iaggregate();
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
311 #else
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
312 HardSIDBuilder *hs = new HardSIDBuilder("HardSID builder");
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
313 myEngine->currBuilder = (sidbuilder *) hs;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
314 if (hs) {
692
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
315 #endif
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
316 /* Builder object created, initialize it */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
317 hs->create((myEngine->currEng->info()).maxsids);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
318 if (!*hs) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
319 xs_error("hardSID->create() failed.\n");
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
320 return FALSE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
321 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
322
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
323 hs->filter(xs_cfg.emulateFilters);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
324 if (!*hs) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
325 xs_error("hardSID->filter(%d) failed.\n", xs_cfg.emulateFilters);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
326 return FALSE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
327 }
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
328 }
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
329 }
321
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
330 #endif
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
331
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
332 if (!myEngine->currBuilder) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
333 xs_error("[SIDPlay2] Could not initialize SIDBuilder object.\n");
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
334 return FALSE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
335 }
321
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
336
692
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
337 #ifndef HAVE_SIDPLAY2_COMI
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
338 myEngine->currConfig.sidEmulation = myEngine->currBuilder;
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
339 XSDEBUG("%s\n", myEngine->currBuilder->credits());
692
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
340 #endif
321
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
341
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
342 /* Clockspeed settings */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
343 switch (xs_cfg.clockSpeed) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
344 case XS_CLOCK_NTSC:
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
345 myEngine->currConfig.clockDefault = SID2_CLOCK_NTSC;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
346 break;
366
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
347
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
348 default:
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
349 xs_error("[SIDPlay2] Invalid clockSpeed=%d, falling back to PAL.\n",
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
350 xs_cfg.clockSpeed);
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
351
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
352 case XS_CLOCK_PAL:
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
353 myEngine->currConfig.clockDefault = SID2_CLOCK_PAL;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
354 xs_cfg.clockSpeed = XS_CLOCK_PAL;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
355 break;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
356 }
366
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
357
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
358
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
359 /* Configure rest of the emulation */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
360
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
361 if (xs_cfg.forceSpeed) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
362 myEngine->currConfig.clockForced = true;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
363 myEngine->currConfig.clockSpeed = myEngine->currConfig.clockDefault;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
364 } else {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
365 myEngine->currConfig.clockForced = false;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
366 myEngine->currConfig.clockSpeed = SID2_CLOCK_CORRECT;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
367 }
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
368
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
369 if ((xs_cfg.sid2OptLevel >= 0) && (xs_cfg.sid2OptLevel <= SID2_MAX_OPTIMISATION))
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
370 myEngine->currConfig.optimisation = xs_cfg.sid2OptLevel;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
371 else {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
372 xs_error("Invalid sid2OptLevel=%d, falling back to %d.\n",
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
373 xs_cfg.sid2OptLevel, SID2_DEFAULT_OPTIMISATION);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
374
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
375 xs_cfg.sid2OptLevel =
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
376 myEngine->currConfig.optimisation = SID2_DEFAULT_OPTIMISATION;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
377 }
366
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
378
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
379 if (xs_cfg.mos8580)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
380 myEngine->currConfig.sidDefault = SID2_MOS8580;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
381 else
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
382 myEngine->currConfig.sidDefault = SID2_MOS6581;
321
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
383
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
384 if (xs_cfg.forceModel)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
385 myEngine->currConfig.sidModel = myEngine->currConfig.sidDefault;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
386 else
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
387 myEngine->currConfig.sidModel = SID2_MODEL_CORRECT;
366
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
388
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
389
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
390 /* XXX: Should this be configurable? libSIDPlay1 does not support it, though */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
391 myEngine->currConfig.sidSamples = TRUE;
321
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
392
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
393
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
394 /* Now set the emulator configuration */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
395 if (myEngine->currEng->config(myEngine->currConfig) < 0) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
396 xs_error("[SIDPlay2] Emulator engine configuration failed!\n");
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
397 return FALSE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
398 }
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
399
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
400 /* Create the sidtune */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
401 myEngine->currTune = new SidTune(0);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
402 if (!myEngine->currTune) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
403 xs_error("[SIDPlay2] Could not initialize SIDTune object.\n");
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
404 return FALSE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
405 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
406
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
407 return TRUE;
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
408 }
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
409
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
410
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
411 /* Close SIDPlay2 engine
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
412 */
657
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 577
diff changeset
413 void xs_sidplay2_close(xs_status_t * myStatus)
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
414 {
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
415 xs_sidplay2_t *myEngine;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
416 assert(myStatus);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
417
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
418 myEngine = (xs_sidplay2_t *) myStatus->sidEngine;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
419
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
420 /* Free internals */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
421 if (myEngine->currBuilder) {
692
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
422 #ifndef HAVE_SIDPLAY2_COMI
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
423 delete myEngine->currBuilder;
692
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
424 #endif
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
425 myEngine->currBuilder = NULL;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
426 }
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
427
692
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
428 #ifndef HAVE_SIDPLAY2_COMI
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
429 if (myEngine->currEng) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
430 delete myEngine->currEng;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
431 myEngine->currEng = NULL;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
432 }
692
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
433 #endif
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
434
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
435 if (myEngine->currTune) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
436 delete myEngine->currTune;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
437 myEngine->currTune = NULL;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
438 }
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
439
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
440 xs_sidplay2_delete(myStatus);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
441
695
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
442 delete myEngine;
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
443 myStatus->sidEngine = NULL;
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
444 }
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
445
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
446
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
447 /* Initialize current song and sub-tune
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
448 */
657
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 577
diff changeset
449 gboolean xs_sidplay2_initsong(xs_status_t * myStatus)
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
450 {
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
451 xs_sidplay2_t *myEngine;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
452 assert(myStatus);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
453
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
454 myEngine = (xs_sidplay2_t *) myStatus->sidEngine;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
455 if (!myEngine) return FALSE;
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
456
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
457 if (!myEngine->currTune->selectSong(myStatus->currSong)) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
458 xs_error("[SIDPlay2] currTune->selectSong() failed\n");
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
459 return FALSE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
460 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
461
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
462 if (myEngine->currEng->load(myEngine->currTune) < 0) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
463 xs_error("[SIDPlay2] currEng->load() failed\n");
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
464 return FALSE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
465 }
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
466
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
467 myStatus->isInitialized = TRUE;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
468
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
469 return TRUE;
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
470 }
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
471
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
472
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
473 /* Emulate and render audio data to given buffer
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
474 */
657
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 577
diff changeset
475 guint xs_sidplay2_fillbuffer(xs_status_t * myStatus, gchar * audioBuffer, guint audioBufSize)
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
476 {
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
477 xs_sidplay2_t *myEngine;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
478 assert(myStatus);
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
479
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
480 myEngine = (xs_sidplay2_t *) myStatus->sidEngine;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
481 if (!myEngine) return 0;
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
482
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
483 return myEngine->currEng->play(audioBuffer, audioBufSize);
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
484 }
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
485
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
486
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
487 /* Load a given SID-tune file
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
488 */
657
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 577
diff changeset
489 gboolean xs_sidplay2_load(xs_status_t * myStatus, gchar * pcFilename)
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
490 {
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
491 xs_sidplay2_t *myEngine;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
492 assert(myStatus);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
493 myStatus->isInitialized = FALSE;
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
494
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
495 myEngine = (xs_sidplay2_t *) myStatus->sidEngine;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
496 if (!myEngine) return FALSE;
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
497
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
498 /* Try to get the tune */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
499 if (!pcFilename) return FALSE;
367
8338cc14bbdb Check for myEngine != NULL
Matti Hamalainen <ccr@tnsp.org>
parents: 366
diff changeset
500
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
501 if (xs_fload_buffer(pcFilename, &(myEngine->buf), &(myEngine->bufSize)) != 0)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
502 return FALSE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
503
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
504 if (!myEngine->currTune->read(myEngine->buf, myEngine->bufSize))
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
505 return FALSE;
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
506
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
507 return TRUE;
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
508 }
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
509
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
510
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
511 /* Delete INTERNAL information
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
512 */
657
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 577
diff changeset
513 void xs_sidplay2_delete(xs_status_t * myStatus)
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
514 {
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
515 xs_sidplay2_t *myEngine;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
516 assert(myStatus);
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
517
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
518 myEngine = (xs_sidplay2_t *) myStatus->sidEngine;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
519 if (!myEngine) return;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
520
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
521 g_free(myEngine->buf);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
522 myEngine->buf = NULL;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
523 myEngine->bufSize = 0;
526
fa95d942f226 Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 474
diff changeset
524 }
fa95d942f226 Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 474
diff changeset
525
fa95d942f226 Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 474
diff changeset
526
fa95d942f226 Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 474
diff changeset
527 /* Hardware backend flushing
fa95d942f226 Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 474
diff changeset
528 */
657
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 577
diff changeset
529 void xs_sidplay2_flush(xs_status_t * myStatus)
526
fa95d942f226 Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 474
diff changeset
530 {
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
531 assert(myStatus);
526
fa95d942f226 Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 474
diff changeset
532
fa95d942f226 Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 474
diff changeset
533 #ifdef HAVE_HARDSID_BUILDER
fa95d942f226 Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 474
diff changeset
534 #ifdef HSID_SID2_COM
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
535 IfPtr<HardSIDBuilder> hs(myStatus->currBuilder);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
536 if (hs)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
537 hs->flush();
526
fa95d942f226 Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 474
diff changeset
538 #else
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
539 if (xs_cfg.sid2Builder == XS_BLD_HARDSID)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
540 ((HardSIDBuilder *) myStatus->currBuilder)->flush();
526
fa95d942f226 Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 474
diff changeset
541 #endif
fa95d942f226 Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 474
diff changeset
542 #endif
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
543 }
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
544
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
545
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
546 } /* extern "C" */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
547 #endif /* HAVE_SIDPLAY2 */