annotate src/xs_sidplay2.cc @ 833:c0e892fa914a

Begin moving libSIDPlay2-FP stuff to a separete module by removing the relevant parts from the libSIDPlay2 backend interface.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 08 Nov 2012 20:45:28 +0200
parents b158abe91a75
children
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
833
c0e892fa914a Begin moving libSIDPlay2-FP stuff to a separete module by removing the
Matti Hamalainen <ccr@tnsp.org>
parents: 832
diff changeset
4 libSIDPlay v2 support
73
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>
744
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
7 (C) Copyright 1999-2012 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
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 #include "xs_sidplay2.h"
832
b158abe91a75 Header include cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 821
diff changeset
28 #include "xs_slsup.h"
73
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
833
c0e892fa914a Begin moving libSIDPlay2-FP stuff to a separete module by removing the
Matti Hamalainen <ccr@tnsp.org>
parents: 832
diff changeset
31 #include <sidplay/sidplay2.h>
c0e892fa914a Begin moving libSIDPlay2-FP stuff to a separete module by removing the
Matti Hamalainen <ccr@tnsp.org>
parents: 832
diff changeset
32 #if G_BYTE_ORDER == G_BIG_ENDIAN
c0e892fa914a Begin moving libSIDPlay2-FP stuff to a separete module by removing the
Matti Hamalainen <ccr@tnsp.org>
parents: 832
diff changeset
33 # define SID2_NATIVE_UNSIGNED SID2_BIG_UNSIGNED
c0e892fa914a Begin moving libSIDPlay2-FP stuff to a separete module by removing the
Matti Hamalainen <ccr@tnsp.org>
parents: 832
diff changeset
34 # define SID2_NATIVE_SIGNED SID2_BIG_SIGNED
c0e892fa914a Begin moving libSIDPlay2-FP stuff to a separete module by removing the
Matti Hamalainen <ccr@tnsp.org>
parents: 832
diff changeset
35 #elif G_BYTE_ORDER == G_LITTLE_ENDIAN
c0e892fa914a Begin moving libSIDPlay2-FP stuff to a separete module by removing the
Matti Hamalainen <ccr@tnsp.org>
parents: 832
diff changeset
36 # define SID2_NATIVE_UNSIGNED SID2_LITTLE_UNSIGNED
c0e892fa914a Begin moving libSIDPlay2-FP stuff to a separete module by removing the
Matti Hamalainen <ccr@tnsp.org>
parents: 832
diff changeset
37 # define SID2_NATIVE_SIGNED SID2_LITTLE_SIGNED
744
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
38 #else
833
c0e892fa914a Begin moving libSIDPlay2-FP stuff to a separete module by removing the
Matti Hamalainen <ccr@tnsp.org>
parents: 832
diff changeset
39 # error Unsupported endianess!
692
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
40 #endif
694
fd81a16434ed Move builder header inclusions.
Matti Hamalainen <ccr@tnsp.org>
parents: 693
diff changeset
41
757
9c135d421676 Clean up endianess handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 756
diff changeset
42
756
8299288df6d2 Rename internal structures.
Matti Hamalainen <ccr@tnsp.org>
parents: 754
diff changeset
43 class XSSIDPlay2 {
695
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
44 public:
770
72e58ecb1a2c Still not working. Urgh.
Matti Hamalainen <ccr@tnsp.org>
parents: 769
diff changeset
45 sidplay2 emu;
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
46 sid2_config_t config;
820
778531e968ed Clean up tune loading.
Matti Hamalainen <ccr@tnsp.org>
parents: 819
diff changeset
47 SidTune tune;
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
48
756
8299288df6d2 Rename internal structures.
Matti Hamalainen <ccr@tnsp.org>
parents: 754
diff changeset
49 XSSIDPlay2(void);
795
3e305ce076e8 Make old libSIDPlay2 support work again, the one available in most distros, such as Debian.
Matti Hamalainen <ccr@tnsp.org>
parents: 791
diff changeset
50 virtual ~XSSIDPlay2(void);
695
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
51 };
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
53
694
fd81a16434ed Move builder header inclusions.
Matti Hamalainen <ccr@tnsp.org>
parents: 693
diff changeset
54 #ifdef HAVE_RESID_BUILDER
833
c0e892fa914a Begin moving libSIDPlay2-FP stuff to a separete module by removing the
Matti Hamalainen <ccr@tnsp.org>
parents: 832
diff changeset
55 # include <sidplay/builders/resid.h>
694
fd81a16434ed Move builder header inclusions.
Matti Hamalainen <ccr@tnsp.org>
parents: 693
diff changeset
56 #endif
744
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
57
694
fd81a16434ed Move builder header inclusions.
Matti Hamalainen <ccr@tnsp.org>
parents: 693
diff changeset
58 #ifdef HAVE_HARDSID_BUILDER
833
c0e892fa914a Begin moving libSIDPlay2-FP stuff to a separete module by removing the
Matti Hamalainen <ccr@tnsp.org>
parents: 832
diff changeset
59 # include <sidplay/builders/hardsid.h>
694
fd81a16434ed Move builder header inclusions.
Matti Hamalainen <ccr@tnsp.org>
parents: 693
diff changeset
60 #endif
fd81a16434ed Move builder header inclusions.
Matti Hamalainen <ccr@tnsp.org>
parents: 693
diff changeset
61
fd81a16434ed Move builder header inclusions.
Matti Hamalainen <ccr@tnsp.org>
parents: 693
diff changeset
62
820
778531e968ed Clean up tune loading.
Matti Hamalainen <ccr@tnsp.org>
parents: 819
diff changeset
63 XSSIDPlay2::XSSIDPlay2(void) : tune(0)
695
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
64 {
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
65 }
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
66
ca594ca1056f COM API support works now.
Matti Hamalainen <ccr@tnsp.org>
parents: 694
diff changeset
67
795
3e305ce076e8 Make old libSIDPlay2 support work again, the one available in most distros, such as Debian.
Matti Hamalainen <ccr@tnsp.org>
parents: 791
diff changeset
68 XSSIDPlay2::~XSSIDPlay2(void)
3e305ce076e8 Make old libSIDPlay2 support work again, the one available in most distros, such as Debian.
Matti Hamalainen <ccr@tnsp.org>
parents: 791
diff changeset
69 {
820
778531e968ed Clean up tune loading.
Matti Hamalainen <ccr@tnsp.org>
parents: 819
diff changeset
70 emu.load(NULL);
795
3e305ce076e8 Make old libSIDPlay2 support work again, the one available in most distros, such as Debian.
Matti Hamalainen <ccr@tnsp.org>
parents: 791
diff changeset
71 }
3e305ce076e8 Make old libSIDPlay2 support work again, the one available in most distros, such as Debian.
Matti Hamalainen <ccr@tnsp.org>
parents: 791
diff changeset
72
3e305ce076e8 Make old libSIDPlay2 support work again, the one available in most distros, such as Debian.
Matti Hamalainen <ccr@tnsp.org>
parents: 791
diff changeset
73
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
74 /* We need to 'export' all this pseudo-C++ crap */
396
0a60ef2b5ab0 Cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 394
diff changeset
75 extern "C" {
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76
75
653c9b0d1320 SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents: 74
diff changeset
77
467
9dafc55c4270 Beginnings of vfs portability.
Matti Hamalainen <ccr@tnsp.org>
parents: 460
diff changeset
78 /* Return song information
9dafc55c4270 Beginnings of vfs portability.
Matti Hamalainen <ccr@tnsp.org>
parents: 460
diff changeset
79 */
692
0126579b6652 Actually compiles now with libsidplay2 COM API, but does not work yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
80 #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
81 #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
82 #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
83 #define TTUNE SidTune
756
8299288df6d2 Rename internal structures.
Matti Hamalainen <ccr@tnsp.org>
parents: 754
diff changeset
84 #define TENGINE XSSIDPlay2
467
9dafc55c4270 Beginnings of vfs portability.
Matti Hamalainen <ccr@tnsp.org>
parents: 460
diff changeset
85 #include "xs_sidplay.h"
9dafc55c4270 Beginnings of vfs portability.
Matti Hamalainen <ccr@tnsp.org>
parents: 460
diff changeset
86
9dafc55c4270 Beginnings of vfs portability.
Matti Hamalainen <ccr@tnsp.org>
parents: 460
diff changeset
87
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
88 /* 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
89 */
751
55eea3fa8868 Rename some structures.
Matti Hamalainen <ccr@tnsp.org>
parents: 748
diff changeset
90 gboolean xs_sidplay2_probe(XSFile *f)
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
91 {
702
b5b6b13a6d85 Renamed some types.
Matti Hamalainen <ccr@tnsp.org>
parents: 700
diff changeset
92 gchar tmpBuf[5];
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
93
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
94 if (!f) return FALSE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
95
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
96 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
97 return FALSE;
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 (!strncmp(tmpBuf, "PSID", 4) || !strncmp(tmpBuf, "RSID", 4))
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
100 return TRUE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
101 else
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
102 return FALSE;
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
103 }
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
104
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
105
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
106 /* Initialize SIDPlay2
75
653c9b0d1320 SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents: 74
diff changeset
107 */
754
5557837fe5b6 Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 753
diff changeset
108 gboolean xs_sidplay2_init(XSEngineState * state)
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
109 {
756
8299288df6d2 Rename internal structures.
Matti Hamalainen <ccr@tnsp.org>
parents: 754
diff changeset
110 XSSIDPlay2 *engine;
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
111 sid_filter_t tmpFilter;
722
5923dfff1fac Unify xs_sid*_filter_t into one.
Matti Hamalainen <ccr@tnsp.org>
parents: 710
diff changeset
112 xs_sid_filter_t *f;
766
19e2745f75d8 Cosmetics and leftover cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 765
diff changeset
113 gint i;
754
5557837fe5b6 Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 753
diff changeset
114 assert(state);
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
115
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
116 /* Allocate internal structures */
756
8299288df6d2 Rename internal structures.
Matti Hamalainen <ccr@tnsp.org>
parents: 754
diff changeset
117 engine = new XSSIDPlay2();
754
5557837fe5b6 Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 753
diff changeset
118 state->internal = engine;
770
72e58ecb1a2c Still not working. Urgh.
Matti Hamalainen <ccr@tnsp.org>
parents: 769
diff changeset
119 if (!engine)
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
120 return FALSE;
75
653c9b0d1320 SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents: 74
diff changeset
121
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
122 /* Get current configuration */
770
72e58ecb1a2c Still not working. Urgh.
Matti Hamalainen <ccr@tnsp.org>
parents: 769
diff changeset
123 engine->config = engine->emu.config();
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
124
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
125 /* Configure channels and stuff */
766
19e2745f75d8 Cosmetics and leftover cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 765
diff changeset
126 switch (state->audioChannels)
19e2745f75d8 Cosmetics and leftover cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 765
diff changeset
127 {
744
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
128 case XS_CHN_AUTOPAN:
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
129 engine->config.playback = sid2_stereo;
744
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
130 break;
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
131
744
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
132 case XS_CHN_STEREO:
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
133 engine->config.playback = sid2_stereo;
744
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
134 break;
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
135
744
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
136 case XS_CHN_MONO:
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
137 default:
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
138 engine->config.playback = sid2_mono;
754
5557837fe5b6 Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 753
diff changeset
139 state->audioChannels = XS_CHN_MONO;
744
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
140 break;
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
141 }
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
142
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
143
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
144 /* Memory mode settings */
766
19e2745f75d8 Cosmetics and leftover cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 765
diff changeset
145 switch (xs_cfg.memoryMode)
19e2745f75d8 Cosmetics and leftover cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 765
diff changeset
146 {
744
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
147 case XS_MPU_BANK_SWITCHING:
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
148 engine->config.environment = sid2_envBS;
744
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
149 break;
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
150
744
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
151 case XS_MPU_TRANSPARENT_ROM:
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
152 engine->config.environment = sid2_envTP;
744
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
153 break;
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
154
744
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
155 case XS_MPU_PLAYSID_ENVIRONMENT:
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
156 engine->config.environment = sid2_envPS;
744
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
157 break;
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
158
744
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
159 case XS_MPU_REAL:
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
160 default:
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
161 engine->config.environment = sid2_envR;
744
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
162 xs_cfg.memoryMode = XS_MPU_REAL;
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
163 break;
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
164 }
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
165
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 /* Audio parameters sanity checking and setup */
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
168 engine->config.precision = state->audioBitsPerSample;
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
169 engine->config.frequency = state->audioFrequency;
748
d9d769b5dbe2 Remove oversampling support.
Matti Hamalainen <ccr@tnsp.org>
parents: 744
diff changeset
170
74
8cb66a3f75f7 Testing
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
171
766
19e2745f75d8 Cosmetics and leftover cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 765
diff changeset
172 switch (state->audioBitsPerSample)
19e2745f75d8 Cosmetics and leftover cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 765
diff changeset
173 {
757
9c135d421676 Clean up endianess handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 756
diff changeset
174 case XS_RES_8BIT:
9c135d421676 Clean up endianess handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 756
diff changeset
175 state->audioFormat = FMT_U8;
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
176 engine->config.sampleFormat = SID2_LITTLE_UNSIGNED;
758
6c8c968595d9 Sanitize some #ifdefs.
Matti Hamalainen <ccr@tnsp.org>
parents: 757
diff changeset
177 break;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
178
757
9c135d421676 Clean up endianess handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 756
diff changeset
179 case XS_RES_16BIT:
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
180 default:
766
19e2745f75d8 Cosmetics and leftover cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 765
diff changeset
181 switch (state->audioFormat)
19e2745f75d8 Cosmetics and leftover cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 765
diff changeset
182 {
757
9c135d421676 Clean up endianess handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 756
diff changeset
183 case FMT_U16_LE:
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
184 engine->config.sampleFormat = SID2_LITTLE_UNSIGNED;
757
9c135d421676 Clean up endianess handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 756
diff changeset
185 break;
9c135d421676 Clean up endianess handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 756
diff changeset
186
9c135d421676 Clean up endianess handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 756
diff changeset
187 case FMT_U16_BE:
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
188 engine->config.sampleFormat = SID2_BIG_UNSIGNED;
757
9c135d421676 Clean up endianess handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 756
diff changeset
189 break;
127
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 103
diff changeset
190
757
9c135d421676 Clean up endianess handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 756
diff changeset
191 case FMT_U16_NE:
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
192 engine->config.sampleFormat = SID2_NATIVE_UNSIGNED;
757
9c135d421676 Clean up endianess handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 756
diff changeset
193 break;
9c135d421676 Clean up endianess handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 756
diff changeset
194
9c135d421676 Clean up endianess handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 756
diff changeset
195 case FMT_S16_LE:
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
196 engine->config.sampleFormat = SID2_LITTLE_SIGNED;
757
9c135d421676 Clean up endianess handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 756
diff changeset
197 break;
9c135d421676 Clean up endianess handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 756
diff changeset
198
9c135d421676 Clean up endianess handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 756
diff changeset
199 case FMT_S16_BE:
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
200 engine->config.sampleFormat = SID2_BIG_SIGNED;
757
9c135d421676 Clean up endianess handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 756
diff changeset
201 break;
9c135d421676 Clean up endianess handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 756
diff changeset
202
9c135d421676 Clean up endianess handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 756
diff changeset
203 default:
821
dea579b6c3b3 Oops, need to set FMT_S16_NE audio format for XMMS output backend as well
Matti Hamalainen <ccr@tnsp.org>
parents: 820
diff changeset
204 state->audioFormat = FMT_S16_NE;
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
205 engine->config.sampleFormat = SID2_NATIVE_SIGNED;
757
9c135d421676 Clean up endianess handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 756
diff changeset
206 break;
766
19e2745f75d8 Cosmetics and leftover cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 765
diff changeset
207 }
19e2745f75d8 Cosmetics and leftover cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 765
diff changeset
208 break;
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
209 }
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
210
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
211 /* Convert filter */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
212 f = &(xs_cfg.sid2Filter);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
213 XSDEBUG("using filter '%s', %d points\n", f->name, f->npoints);
766
19e2745f75d8 Cosmetics and leftover cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 765
diff changeset
214 if (f->npoints > XS_SIDPLAY2_NFPOINTS)
19e2745f75d8 Cosmetics and leftover cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 765
diff changeset
215 {
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
216 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
217 f->npoints, XS_SIDPLAY2_NFPOINTS);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
218 f->npoints = XS_SIDPLAY2_NFPOINTS;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
219 }
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
220
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
221 tmpFilter.points = f->npoints;
766
19e2745f75d8 Cosmetics and leftover cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 765
diff changeset
222 for (i = 0; i < f->npoints; i++)
19e2745f75d8 Cosmetics and leftover cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 765
diff changeset
223 {
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
224 tmpFilter.cutoff[i][0] = f->points[i].x;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
225 tmpFilter.cutoff[i][1] = f->points[i].y;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
226 }
352
2b4ca75b999f Cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
227
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
228 /* Initialize builder object */
770
72e58ecb1a2c Still not working. Urgh.
Matti Hamalainen <ccr@tnsp.org>
parents: 769
diff changeset
229 XSDEBUG("init builder #%i, maxsids=%i\n", xs_cfg.sid2Builder, (engine->emu.info()).maxsids);
761
641b7693fecc Cosmetic cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 758
diff changeset
230
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
231 switch (xs_cfg.sid2Builder)
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
232 {
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
233 #ifdef HAVE_RESID_BUILDER
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
234 case XS_BLD_RESID:
773
45108b3d88db Add resid-fp and resid backend to sidplay2fp support.
Matti Hamalainen <ccr@tnsp.org>
parents: 770
diff changeset
235 {
45108b3d88db Add resid-fp and resid backend to sidplay2fp support.
Matti Hamalainen <ccr@tnsp.org>
parents: 770
diff changeset
236 ReSIDBuilder *rs = new ReSIDBuilder("ReSID builder");
45108b3d88db Add resid-fp and resid backend to sidplay2fp support.
Matti Hamalainen <ccr@tnsp.org>
parents: 770
diff changeset
237 if (rs)
45108b3d88db Add resid-fp and resid backend to sidplay2fp support.
Matti Hamalainen <ccr@tnsp.org>
parents: 770
diff changeset
238 {
45108b3d88db Add resid-fp and resid backend to sidplay2fp support.
Matti Hamalainen <ccr@tnsp.org>
parents: 770
diff changeset
239 engine->config.sidEmulation = rs;
45108b3d88db Add resid-fp and resid backend to sidplay2fp support.
Matti Hamalainen <ccr@tnsp.org>
parents: 770
diff changeset
240 if (!*rs) return FALSE;
45108b3d88db Add resid-fp and resid backend to sidplay2fp support.
Matti Hamalainen <ccr@tnsp.org>
parents: 770
diff changeset
241 rs->create((engine->emu.info()).maxsids);
45108b3d88db Add resid-fp and resid backend to sidplay2fp support.
Matti Hamalainen <ccr@tnsp.org>
parents: 770
diff changeset
242 if (!*rs) return FALSE;
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
243 }
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
244 }
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
245 break;
321
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
246 #endif
744
c7fa50576c70 Initial implementation for supporting libSIDPlay2-FP (or libSIDPlay-FP, as
Matti Hamalainen <ccr@tnsp.org>
parents: 723
diff changeset
247
321
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
248 #ifdef HAVE_HARDSID_BUILDER
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
249 case XS_BLD_HARDSID:
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
250 {
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
251 HardSIDBuilder *hs = new HardSIDBuilder("HardSID builder (FP)");
770
72e58ecb1a2c Still not working. Urgh.
Matti Hamalainen <ccr@tnsp.org>
parents: 769
diff changeset
252 engine->config.sidEmulation = (sidbuilder *) hs;
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
253 if (hs)
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
254 {
770
72e58ecb1a2c Still not working. Urgh.
Matti Hamalainen <ccr@tnsp.org>
parents: 769
diff changeset
255 hs->create((engine->emu.info()).maxsids);
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
256 if (!*hs)
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
257 {
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
258 xs_error("hardSID->create() failed.\n");
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
259 return FALSE;
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
260 }
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
261 }
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
262 }
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
263 break;
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
264 #endif
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
265
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
266 default:
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
267 xs_error("[SIDPlay2] Invalid or unsupported builder selected.\n");
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
268 break;
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
269 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
270
770
72e58ecb1a2c Still not working. Urgh.
Matti Hamalainen <ccr@tnsp.org>
parents: 769
diff changeset
271 if (!engine->config.sidEmulation)
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
272 {
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
273 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
274 return FALSE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
275 }
321
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
276
833
c0e892fa914a Begin moving libSIDPlay2-FP stuff to a separete module by removing the
Matti Hamalainen <ccr@tnsp.org>
parents: 832
diff changeset
277 #if 0
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
278 // Setup filter
770
72e58ecb1a2c Still not working. Urgh.
Matti Hamalainen <ccr@tnsp.org>
parents: 769
diff changeset
279 engine->config.sidEmulation->filter(xs_cfg.emulateFilters);
72e58ecb1a2c Still not working. Urgh.
Matti Hamalainen <ccr@tnsp.org>
parents: 769
diff changeset
280 if (!*(engine->config.sidEmulation))
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
281 {
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
282 xs_error("builder->filter(%d) failed.\n", xs_cfg.emulateFilters);
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
283 return FALSE;
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
284 }
795
3e305ce076e8 Make old libSIDPlay2 support work again, the one available in most distros, such as Debian.
Matti Hamalainen <ccr@tnsp.org>
parents: 791
diff changeset
285 #endif
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
286
770
72e58ecb1a2c Still not working. Urgh.
Matti Hamalainen <ccr@tnsp.org>
parents: 769
diff changeset
287 XSDEBUG("%s\n", engine->config.sidEmulation->credits());
321
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
288
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
289 /* Clockspeed settings */
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
290 switch (xs_cfg.clockSpeed)
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
291 {
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
292 case XS_CLOCK_NTSC:
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
293 engine->config.clockDefault = SID2_CLOCK_NTSC;
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
294 break;
366
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
295
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
296 default:
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
297 case XS_CLOCK_PAL:
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
298 engine->config.clockDefault = SID2_CLOCK_PAL;
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
299 xs_cfg.clockSpeed = XS_CLOCK_PAL;
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
300 break;
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
301 }
366
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
302
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
303
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
304 /* Configure rest of the emulation */
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
305 if (xs_cfg.forceSpeed)
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
306 {
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
307 engine->config.clockForced = true;
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
308 engine->config.clockSpeed = engine->config.clockDefault;
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
309 }
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
310 else
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
311 {
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
312 engine->config.clockForced = false;
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
313 engine->config.clockSpeed = SID2_CLOCK_CORRECT;
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
314 }
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
315
710
a6283cf95c99 Updated to work with latest distortion patched libSIDPlay2+reSID from Antti
Matti Hamalainen <ccr@tnsp.org>
parents: 702
diff changeset
316
761
641b7693fecc Cosmetic cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 758
diff changeset
317 if (xs_cfg.sid2OptLevel < 0 || xs_cfg.sid2OptLevel > SID2_MAX_OPTIMISATION)
641b7693fecc Cosmetic cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 758
diff changeset
318 {
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
319 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
320 xs_cfg.sid2OptLevel, SID2_DEFAULT_OPTIMISATION);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
321
761
641b7693fecc Cosmetic cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 758
diff changeset
322 xs_cfg.sid2OptLevel = SID2_DEFAULT_OPTIMISATION;
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
323 }
766
19e2745f75d8 Cosmetics and leftover cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 765
diff changeset
324 engine->config.optimisation = xs_cfg.sid2OptLevel;
366
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
325
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
326 engine->config.sidDefault = xs_cfg.mos8580 ? SID2_MOS8580 : SID2_MOS6581;
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
327 engine->config.sidModel = xs_cfg.forceModel ? engine->config.sidDefault : SID2_MODEL_CORRECT;
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
328 engine->config.sidSamples = TRUE;
321
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
329
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
330 return TRUE;
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
331 }
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
332
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
333
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
334 /* Close SIDPlay2 engine
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
335 */
754
5557837fe5b6 Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 753
diff changeset
336 void xs_sidplay2_close(XSEngineState * state)
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
337 {
769
120d6f247f1b Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 768
diff changeset
338 XSSIDPlay2 *engine = (XSSIDPlay2 *) state->internal;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
339
775
0e9f2894b0a9 Proper order of freeing/deletion.
Matti Hamalainen <ccr@tnsp.org>
parents: 774
diff changeset
340 xs_sidplay2_delete(state);
0e9f2894b0a9 Proper order of freeing/deletion.
Matti Hamalainen <ccr@tnsp.org>
parents: 774
diff changeset
341
770
72e58ecb1a2c Still not working. Urgh.
Matti Hamalainen <ccr@tnsp.org>
parents: 769
diff changeset
342 if (engine)
72e58ecb1a2c Still not working. Urgh.
Matti Hamalainen <ccr@tnsp.org>
parents: 769
diff changeset
343 {
72e58ecb1a2c Still not working. Urgh.
Matti Hamalainen <ccr@tnsp.org>
parents: 769
diff changeset
344 delete engine;
775
0e9f2894b0a9 Proper order of freeing/deletion.
Matti Hamalainen <ccr@tnsp.org>
parents: 774
diff changeset
345 engine = NULL;
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
346 }
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
347
754
5557837fe5b6 Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 753
diff changeset
348 state->internal = NULL;
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
349 }
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
350
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
351
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
352 /* Initialize current song and sub-tune
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
353 */
754
5557837fe5b6 Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 753
diff changeset
354 gboolean xs_sidplay2_initsong(XSEngineState * state)
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
355 {
768
f145ba458acd Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 766
diff changeset
356 XSSIDPlay2 *engine = (XSSIDPlay2 *) state->internal;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
357
768
f145ba458acd Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 766
diff changeset
358 if (!engine)
f145ba458acd Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 766
diff changeset
359 return FALSE;
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
360
820
778531e968ed Clean up tune loading.
Matti Hamalainen <ccr@tnsp.org>
parents: 819
diff changeset
361 if (!engine->tune.selectSong(state->currSong))
769
120d6f247f1b Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 768
diff changeset
362 {
820
778531e968ed Clean up tune loading.
Matti Hamalainen <ccr@tnsp.org>
parents: 819
diff changeset
363 xs_error("[SIDPlay2] tune.selectSong() failed\n");
778531e968ed Clean up tune loading.
Matti Hamalainen <ccr@tnsp.org>
parents: 819
diff changeset
364 return FALSE;
778531e968ed Clean up tune loading.
Matti Hamalainen <ccr@tnsp.org>
parents: 819
diff changeset
365 }
778531e968ed Clean up tune loading.
Matti Hamalainen <ccr@tnsp.org>
parents: 819
diff changeset
366
778531e968ed Clean up tune loading.
Matti Hamalainen <ccr@tnsp.org>
parents: 819
diff changeset
367 if (engine->emu.load(&(engine->tune)) < 0)
778531e968ed Clean up tune loading.
Matti Hamalainen <ccr@tnsp.org>
parents: 819
diff changeset
368 {
778531e968ed Clean up tune loading.
Matti Hamalainen <ccr@tnsp.org>
parents: 819
diff changeset
369 xs_error("[SIDPlay2] emu.load() failed\n");
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
370 return FALSE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
371 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
372
795
3e305ce076e8 Make old libSIDPlay2 support work again, the one available in most distros, such as Debian.
Matti Hamalainen <ccr@tnsp.org>
parents: 791
diff changeset
373 if (engine->emu.config(engine->config) < 0)
3e305ce076e8 Make old libSIDPlay2 support work again, the one available in most distros, such as Debian.
Matti Hamalainen <ccr@tnsp.org>
parents: 791
diff changeset
374 {
3e305ce076e8 Make old libSIDPlay2 support work again, the one available in most distros, such as Debian.
Matti Hamalainen <ccr@tnsp.org>
parents: 791
diff changeset
375 xs_error("[SIDPlay2] Emulator engine configuration failed!\n");
3e305ce076e8 Make old libSIDPlay2 support work again, the one available in most distros, such as Debian.
Matti Hamalainen <ccr@tnsp.org>
parents: 791
diff changeset
376 return FALSE;
3e305ce076e8 Make old libSIDPlay2 support work again, the one available in most distros, such as Debian.
Matti Hamalainen <ccr@tnsp.org>
parents: 791
diff changeset
377 }
3e305ce076e8 Make old libSIDPlay2 support work again, the one available in most distros, such as Debian.
Matti Hamalainen <ccr@tnsp.org>
parents: 791
diff changeset
378
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
379 return TRUE;
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
380 }
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
381
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
382
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
383 /* 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
384 */
754
5557837fe5b6 Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 753
diff changeset
385 guint xs_sidplay2_fillbuffer(XSEngineState * state, gchar * audioBuffer, guint audioBufSize)
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
386 {
768
f145ba458acd Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 766
diff changeset
387 XSSIDPlay2 *engine = (XSSIDPlay2 *) state->internal;
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
388
768
f145ba458acd Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 766
diff changeset
389 if (!engine)
f145ba458acd Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 766
diff changeset
390 return 0;
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
391
795
3e305ce076e8 Make old libSIDPlay2 support work again, the one available in most distros, such as Debian.
Matti Hamalainen <ccr@tnsp.org>
parents: 791
diff changeset
392 return engine->emu.play(audioBuffer, audioBufSize);
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
393 }
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
394
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
395
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
396 /* Load a given SID-tune file
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
397 */
765
1294df516d2e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 761
diff changeset
398 gboolean xs_sidplay2_load(XSEngineState * state, gchar * filename)
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
399 {
768
f145ba458acd Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 766
diff changeset
400 XSSIDPlay2 *engine = (XSSIDPlay2 *) state->internal;
f145ba458acd Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 766
diff changeset
401
820
778531e968ed Clean up tune loading.
Matti Hamalainen <ccr@tnsp.org>
parents: 819
diff changeset
402 if (!engine || !filename)
768
f145ba458acd Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 766
diff changeset
403 return FALSE;
795
3e305ce076e8 Make old libSIDPlay2 support work again, the one available in most distros, such as Debian.
Matti Hamalainen <ccr@tnsp.org>
parents: 791
diff changeset
404
820
778531e968ed Clean up tune loading.
Matti Hamalainen <ccr@tnsp.org>
parents: 819
diff changeset
405 engine->tune.load(filename);
778531e968ed Clean up tune loading.
Matti Hamalainen <ccr@tnsp.org>
parents: 819
diff changeset
406 if (!engine->tune)
778531e968ed Clean up tune loading.
Matti Hamalainen <ccr@tnsp.org>
parents: 819
diff changeset
407 {
778531e968ed Clean up tune loading.
Matti Hamalainen <ccr@tnsp.org>
parents: 819
diff changeset
408 xs_error("Could not load file '%s': %s\n",
778531e968ed Clean up tune loading.
Matti Hamalainen <ccr@tnsp.org>
parents: 819
diff changeset
409 filename, (engine->tune.getInfo()).statusString);
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
410 return FALSE;
820
778531e968ed Clean up tune loading.
Matti Hamalainen <ccr@tnsp.org>
parents: 819
diff changeset
411 }
795
3e305ce076e8 Make old libSIDPlay2 support work again, the one available in most distros, such as Debian.
Matti Hamalainen <ccr@tnsp.org>
parents: 791
diff changeset
412
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
413 return TRUE;
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
414 }
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
415
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
416
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
417 /* Delete INTERNAL information
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
418 */
754
5557837fe5b6 Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 753
diff changeset
419 void xs_sidplay2_delete(XSEngineState * state)
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
420 {
768
f145ba458acd Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 766
diff changeset
421 XSSIDPlay2 *engine = (XSSIDPlay2 *) state->internal;
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
422 }
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
423
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
424
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
425 /* 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
426 */
754
5557837fe5b6 Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 753
diff changeset
427 void xs_sidplay2_flush(XSEngineState * state)
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
428 {
779
8fb51f9ef44e Fix some HardSID builder related things.
Matti Hamalainen <ccr@tnsp.org>
parents: 776
diff changeset
429 XSSIDPlay2 *engine = (XSSIDPlay2 *) state->internal;
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
430
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
431 #ifdef HAVE_HARDSID_BUILDER
768
f145ba458acd Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 766
diff changeset
432 if (xs_cfg.sid2Builder == XS_BLD_HARDSID)
f145ba458acd Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 766
diff changeset
433 {
779
8fb51f9ef44e Fix some HardSID builder related things.
Matti Hamalainen <ccr@tnsp.org>
parents: 776
diff changeset
434 ((HardSIDBuilder *) engine->config.sidEmulation)->flush();
768
f145ba458acd Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 766
diff changeset
435 }
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
436 #endif
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
437 }
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
438
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
439
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
440 } /* extern "C" */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
441 #endif /* HAVE_SIDPLAY2 */