Mercurial > hg > xmms-sid
annotate src/xs_sidplay1.cpp @ 939:49b689449a37
Change xs_read_configuration() to return a boolean value, TRUE if
configuration was successfully read for all items, FALSE if not. Failure
might be non-existent or partial configuration (old/incompatible version.)
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 19 Nov 2012 17:57:05 +0200 |
parents | 3a9bf45178ff |
children | a5b118c853f5 |
rev | line source |
---|---|
71
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1 /* |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2 XMMS-SID - SIDPlay input plugin for X MultiMedia System (XMMS) |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3 |
837 | 4 libSIDPlay1 support |
71
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
5 |
324 | 6 Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> |
539 | 7 (C) Copyright 1999-2007 Tecnic Software productions (TNSP) |
71
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
8 |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
9 This program is free software; you can redistribute it and/or modify |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
10 it under the terms of the GNU General Public License as published by |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
11 the Free Software Foundation; either version 2 of the License, or |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
12 (at your option) any later version. |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
13 |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
14 This program is distributed in the hope that it will be useful, |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
15 but WITHOUT ANY WARRANTY; without even the implied warranty of |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
17 GNU General Public License for more details. |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
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:
411
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:
411
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:
411
diff
changeset
|
21 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
71
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
22 */ |
73
2bc607888f53
Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
72
diff
changeset
|
23 #include "xmms-sid.h" |
2bc607888f53
Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
72
diff
changeset
|
24 |
71
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
25 #ifdef HAVE_SIDPLAY1 |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
26 |
73
2bc607888f53
Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
72
diff
changeset
|
27 #include "xs_sidplay1.h" |
832 | 28 #include "xs_slsup.h" |
73
2bc607888f53
Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
72
diff
changeset
|
29 #include "xs_config.h" |
71
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
30 |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
31 #include <sidplay/player.h> |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
32 #include <sidplay/myendian.h> |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
33 #include <sidplay/fformat.h> |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
34 |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
35 |
526
fa95d942f226
Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
467
diff
changeset
|
36 /* Maximum audio frequency supported by libSIDPlay v1 */ |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
37 #define SIDPLAY1_MAX_FREQ (48000) |
526
fa95d942f226
Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
467
diff
changeset
|
38 |
fa95d942f226
Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
467
diff
changeset
|
39 |
396 | 40 typedef struct { |
764 | 41 emuEngine *emu; |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
42 emuConfig currConfig; |
764 | 43 sidTune *tune; |
756
8299288df6d2
Rename internal structures.
Matti Hamalainen <ccr@tnsp.org>
parents:
754
diff
changeset
|
44 } XSSIDPlay1; |
73
2bc607888f53
Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
72
diff
changeset
|
45 |
2bc607888f53
Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
72
diff
changeset
|
46 |
270
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
47 /* We need to 'export' all this pseudo-C++ crap */ |
396 | 48 extern "C" { |
73
2bc607888f53
Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
72
diff
changeset
|
49 |
75
653c9b0d1320
SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents:
74
diff
changeset
|
50 |
270
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
51 /* 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
|
52 */ |
751 | 53 gboolean xs_sidplay1_probe(XSFile *f) |
364
421e4fc13bce
More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
54 { |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
55 gchar tmpBuf[4]; |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
56 |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
57 if (!f) return FALSE; |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
58 |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
59 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
|
60 return FALSE; |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
61 |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
62 if (!strncmp(tmpBuf, "PSID", 4)) |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
63 return TRUE; |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
64 else |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
65 return FALSE; |
364
421e4fc13bce
More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
66 } |
73
2bc607888f53
Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
72
diff
changeset
|
67 |
2bc607888f53
Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
72
diff
changeset
|
68 |
270
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
69 /* Initialize SIDPlay1 |
75
653c9b0d1320
SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents:
74
diff
changeset
|
70 */ |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
71 gboolean xs_sidplay1_init(XSEngineState * state) |
364
421e4fc13bce
More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
72 { |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
73 gint tmpFreq; |
756
8299288df6d2
Rename internal structures.
Matti Hamalainen <ccr@tnsp.org>
parents:
754
diff
changeset
|
74 XSSIDPlay1 *engine; |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
75 assert(state); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
76 |
847
5b93bd8c7814
Cleanups, adjust backend configuration sequences, more error checking,
Matti Hamalainen <ccr@tnsp.org>
parents:
837
diff
changeset
|
77 XSDEBUG("SIDPlay1 backend initializing.\n"); |
5b93bd8c7814
Cleanups, adjust backend configuration sequences, more error checking,
Matti Hamalainen <ccr@tnsp.org>
parents:
837
diff
changeset
|
78 |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
79 /* Allocate internal structures */ |
756
8299288df6d2
Rename internal structures.
Matti Hamalainen <ccr@tnsp.org>
parents:
754
diff
changeset
|
80 engine = (XSSIDPlay1 *) g_malloc0(sizeof(XSSIDPlay1)); |
847
5b93bd8c7814
Cleanups, adjust backend configuration sequences, more error checking,
Matti Hamalainen <ccr@tnsp.org>
parents:
837
diff
changeset
|
81 if (!engine) |
5b93bd8c7814
Cleanups, adjust backend configuration sequences, more error checking,
Matti Hamalainen <ccr@tnsp.org>
parents:
837
diff
changeset
|
82 return FALSE; |
72
e3b205a6bc7e
Lots re-arranging and new code for upcoming modularization.
Matti Hamalainen <ccr@tnsp.org>
parents:
71
diff
changeset
|
83 |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
84 /* Initialize engine */ |
764 | 85 engine->emu = new emuEngine(); |
837 | 86 if (!engine->emu) |
87 { | |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
88 xs_error("[SIDPlay1] Could not initialize emulation engine.\n"); |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
89 g_free(engine); |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
90 return FALSE; |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
91 } |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
92 |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
93 /* Verify endianess */ |
837 | 94 if (!engine->emu->verifyEndianess()) |
95 { | |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
96 xs_error("[SIDPlay1] Endianess verification failed.\n"); |
764 | 97 delete engine->emu; |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
98 g_free(engine); |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
99 return FALSE; |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
100 } |
72
e3b205a6bc7e
Lots re-arranging and new code for upcoming modularization.
Matti Hamalainen <ccr@tnsp.org>
parents:
71
diff
changeset
|
101 |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
102 state->internal = engine; |
71
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
103 |
847
5b93bd8c7814
Cleanups, adjust backend configuration sequences, more error checking,
Matti Hamalainen <ccr@tnsp.org>
parents:
837
diff
changeset
|
104 XSDEBUG("SIDPlay1 emulation configuration\n"); |
5b93bd8c7814
Cleanups, adjust backend configuration sequences, more error checking,
Matti Hamalainen <ccr@tnsp.org>
parents:
837
diff
changeset
|
105 |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
106 /* Get current configuration */ |
764 | 107 engine->emu->getConfig(engine->currConfig); |
71
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
108 |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
109 /* Configure channel parameters */ |
837 | 110 switch (state->audioChannels) |
111 { | |
112 case XS_CHN_AUTOPAN: | |
113 engine->currConfig.channels = SIDEMU_STEREO; | |
114 engine->currConfig.autoPanning = SIDEMU_CENTEREDAUTOPANNING; | |
115 engine->currConfig.volumeControl = SIDEMU_FULLPANNING; | |
116 break; | |
71
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
117 |
837 | 118 case XS_CHN_STEREO: |
119 engine->currConfig.channels = SIDEMU_STEREO; | |
120 engine->currConfig.autoPanning = SIDEMU_NONE; | |
121 engine->currConfig.volumeControl = SIDEMU_NONE; | |
122 break; | |
71
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
123 |
837 | 124 case XS_CHN_MONO: |
125 default: | |
126 engine->currConfig.channels = SIDEMU_MONO; | |
127 engine->currConfig.autoPanning = SIDEMU_NONE; | |
128 engine->currConfig.volumeControl = SIDEMU_NONE; | |
129 state->audioChannels = XS_CHN_MONO; | |
130 break; | |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
131 } |
71
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
132 |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
133 |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
134 /* Memory mode settings */ |
837 | 135 switch (xs_cfg.memoryMode) |
136 { | |
137 case XS_MPU_TRANSPARENT_ROM: | |
138 engine->currConfig.memoryMode = MPU_TRANSPARENT_ROM; | |
139 break; | |
71
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
140 |
837 | 141 case XS_MPU_PLAYSID_ENVIRONMENT: |
142 engine->currConfig.memoryMode = MPU_PLAYSID_ENVIRONMENT; | |
143 break; | |
71
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
144 |
837 | 145 case XS_MPU_BANK_SWITCHING: |
146 default: | |
147 engine->currConfig.memoryMode = MPU_BANK_SWITCHING; | |
148 xs_cfg.memoryMode = XS_MPU_BANK_SWITCHING; | |
149 break; | |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
150 } |
71
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
151 |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
152 |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
153 /* Audio parameters sanity checking and setup */ |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
154 engine->currConfig.bitsPerSample = state->audioBitsPerSample; |
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
155 tmpFreq = state->audioFrequency; |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
156 |
748
d9d769b5dbe2
Remove oversampling support.
Matti Hamalainen <ccr@tnsp.org>
parents:
713
diff
changeset
|
157 if (tmpFreq > SIDPLAY1_MAX_FREQ) |
d9d769b5dbe2
Remove oversampling support.
Matti Hamalainen <ccr@tnsp.org>
parents:
713
diff
changeset
|
158 tmpFreq = SIDPLAY1_MAX_FREQ; |
270
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
159 |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
160 engine->currConfig.frequency = tmpFreq; |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
161 |
837 | 162 switch (state->audioBitsPerSample) |
163 { | |
164 case XS_RES_8BIT: | |
165 switch (state->audioFormat) | |
166 { | |
167 case FMT_S8: | |
168 state->audioFormat = FMT_S8; | |
169 engine->currConfig.sampleFormat = SIDEMU_SIGNED_PCM; | |
170 break; | |
171 | |
172 case FMT_U8: | |
173 default: | |
174 state->audioFormat = FMT_U8; | |
175 engine->currConfig.sampleFormat = SIDEMU_UNSIGNED_PCM; | |
176 break; | |
177 } | |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
178 break; |
127
ddb513bd2610
Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents:
103
diff
changeset
|
179 |
837 | 180 case XS_RES_16BIT: |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
181 default: |
837 | 182 switch (state->audioFormat) |
183 { | |
184 case FMT_U16_NE: | |
185 case FMT_U16_LE: | |
186 case FMT_U16_BE: | |
187 state->audioFormat = FMT_U16_NE; | |
188 engine->currConfig.sampleFormat = SIDEMU_UNSIGNED_PCM; | |
189 break; | |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
190 |
837 | 191 case FMT_S16_NE: |
192 case FMT_S16_LE: | |
193 case FMT_S16_BE: | |
194 default: | |
195 state->audioFormat = FMT_S16_NE; | |
196 engine->currConfig.sampleFormat = SIDEMU_SIGNED_PCM; | |
197 break; | |
198 } | |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
199 break; |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
200 } |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
201 |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
202 /* Clockspeed settings */ |
837 | 203 switch (xs_cfg.clockSpeed) |
204 { | |
205 case XS_CLOCK_NTSC: | |
206 engine->currConfig.clockSpeed = SIDTUNE_CLOCK_NTSC; | |
207 break; | |
368
3e55874170eb
Cleanups, additional engine NULL check.
Matti Hamalainen <ccr@tnsp.org>
parents:
364
diff
changeset
|
208 |
837 | 209 case XS_CLOCK_PAL: |
210 default: | |
211 engine->currConfig.clockSpeed = SIDTUNE_CLOCK_PAL; | |
212 xs_cfg.clockSpeed = XS_CLOCK_PAL; | |
213 break; | |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
214 } |
368
3e55874170eb
Cleanups, additional engine NULL check.
Matti Hamalainen <ccr@tnsp.org>
parents:
364
diff
changeset
|
215 |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
216 engine->currConfig.forceSongSpeed = xs_cfg.forceSpeed; |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
217 |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
218 |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
219 /* Configure rest of the emulation */ |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
220 /* if (xs_cfg.forceModel) */ |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
221 engine->currConfig.mos8580 = xs_cfg.mos8580; |
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
222 engine->currConfig.emulateFilter = xs_cfg.emulateFilters; |
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
223 engine->currConfig.filterFs = xs_cfg.sid1Filter.fs; |
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
224 engine->currConfig.filterFm = xs_cfg.sid1Filter.fm; |
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
225 engine->currConfig.filterFt = xs_cfg.sid1Filter.ft; |
368
3e55874170eb
Cleanups, additional engine NULL check.
Matti Hamalainen <ccr@tnsp.org>
parents:
364
diff
changeset
|
226 |
3e55874170eb
Cleanups, additional engine NULL check.
Matti Hamalainen <ccr@tnsp.org>
parents:
364
diff
changeset
|
227 |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
228 /* Now set the emulator configuration */ |
837 | 229 if (!engine->emu->setConfig(engine->currConfig)) |
230 { | |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
231 xs_error("[SIDPlay1] Emulator engine configuration failed!\n"); |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
232 return FALSE; |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
233 } |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
234 |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
235 /* Create sidtune object */ |
764 | 236 engine->tune = new sidTune(0); |
837 | 237 if (!engine->tune) |
238 { | |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
239 xs_error("[SIDPlay1] Could not initialize SIDTune object.\n"); |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
240 return FALSE; |
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 |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
243 return TRUE; |
364
421e4fc13bce
More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
244 } |
421e4fc13bce
More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
245 |
270
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
246 |
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
247 /* Close SIDPlay1 engine |
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
248 */ |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
249 void xs_sidplay1_close(XSEngineState * state) |
364
421e4fc13bce
More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
250 { |
756
8299288df6d2
Rename internal structures.
Matti Hamalainen <ccr@tnsp.org>
parents:
754
diff
changeset
|
251 XSSIDPlay1 *engine; |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
252 assert(state); |
270
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
253 |
847
5b93bd8c7814
Cleanups, adjust backend configuration sequences, more error checking,
Matti Hamalainen <ccr@tnsp.org>
parents:
837
diff
changeset
|
254 XSDEBUG("SIDPlay1 backend shutdown.\n"); |
5b93bd8c7814
Cleanups, adjust backend configuration sequences, more error checking,
Matti Hamalainen <ccr@tnsp.org>
parents:
837
diff
changeset
|
255 |
756
8299288df6d2
Rename internal structures.
Matti Hamalainen <ccr@tnsp.org>
parents:
754
diff
changeset
|
256 engine = (XSSIDPlay1 *) state->internal; |
270
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
257 |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
258 /* Free internals */ |
837 | 259 if (engine->emu) |
260 { | |
764 | 261 delete engine->emu; |
262 engine->emu = NULL; | |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
263 } |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
264 |
837 | 265 if (engine->tune) |
266 { | |
764 | 267 delete engine->tune; |
268 engine->tune = NULL; | |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
269 } |
527
fe8b41abd923
Now everything necessary should be using the VFS functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
526
diff
changeset
|
270 |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
271 xs_sidplay1_delete(state); |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
272 |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
273 g_free(engine); |
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
274 state->internal = NULL; |
364
421e4fc13bce
More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
275 } |
270
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
276 |
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
277 |
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
278 /* Initialize current song and sub-tune |
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
279 */ |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
280 gboolean xs_sidplay1_initsong(XSEngineState * state) |
364
421e4fc13bce
More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
281 { |
756
8299288df6d2
Rename internal structures.
Matti Hamalainen <ccr@tnsp.org>
parents:
754
diff
changeset
|
282 XSSIDPlay1 *engine; |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
283 assert(state); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
284 |
756
8299288df6d2
Rename internal structures.
Matti Hamalainen <ccr@tnsp.org>
parents:
754
diff
changeset
|
285 engine = (XSSIDPlay1 *) state->internal; |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
286 if (!engine) return FALSE; |
270
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
287 |
837 | 288 if (!engine->tune) |
289 { | |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
290 xs_error("[SIDPlay1] SID-tune struct pointer was NULL. This should not happen, report to XMMS-SID author.\n"); |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
291 return FALSE; |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
292 } |
270
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
293 |
837 | 294 if (!engine->tune->getStatus()) |
295 { | |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
296 xs_error("[SIDPlay1] SID-tune status check failed. This should not happen, report to XMMS-SID author.\n"); |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
297 return FALSE; |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
298 } |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
299 |
764 | 300 return sidEmuInitializeSong(*engine->emu, *engine->tune, state->currSong); |
364
421e4fc13bce
More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
301 } |
270
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
302 |
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
303 |
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
304 /* 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
|
305 */ |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
306 guint xs_sidplay1_fillbuffer(XSEngineState * state, gchar * audioBuffer, guint audioBufSize) |
364
421e4fc13bce
More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
307 { |
756
8299288df6d2
Rename internal structures.
Matti Hamalainen <ccr@tnsp.org>
parents:
754
diff
changeset
|
308 XSSIDPlay1 *engine; |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
309 assert(state); |
270
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
310 |
756
8299288df6d2
Rename internal structures.
Matti Hamalainen <ccr@tnsp.org>
parents:
754
diff
changeset
|
311 engine = (XSSIDPlay1 *) state->internal; |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
312 if (!engine) return 0; |
270
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
313 |
764 | 314 sidEmuFillBuffer(*engine->emu, *engine->tune, audioBuffer, audioBufSize); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
315 |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
316 return audioBufSize; |
364
421e4fc13bce
More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
317 } |
270
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
318 |
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
319 |
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
320 /* Load a given SID-tune file |
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
321 */ |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
322 gboolean xs_sidplay1_load(XSEngineState * state, gchar * filename) |
364
421e4fc13bce
More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
323 { |
869
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
324 XSSIDPlay1 *engine = (XSSIDPlay1 *) state->internal; |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
325 gboolean res = FALSE; |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
326 guint8 *buf = NULL; |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
327 size_t bufSize; |
270
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
328 |
862
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
329 if (!engine) |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
330 return FALSE; |
270
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
331 |
869
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
332 if (!xs_fload_buffer(filename, &buf, &bufSize, XS_SIDBUF_SIZE, TRUE)) |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
333 goto error; |
71
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
334 |
869
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
335 if (!engine->tune->load(buf, bufSize)) |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
336 { |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
337 xs_error("could not initialize tune from buffer, %p:%d '%s'.\n", |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
338 buf, bufSize, filename); |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
339 goto error; |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
340 } |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
341 |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
342 res = TRUE; |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
343 |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
344 error: |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
345 g_free(buf); |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
346 return res; |
364
421e4fc13bce
More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
347 } |
71
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
348 |
2b32c75729ce
Started modularizing, separated sidplay1 things into a "wrapper" module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
349 |
270
583f5651abff
Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents:
232
diff
changeset
|
350 /* Delete INTERNAL information |
73
2bc607888f53
Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
72
diff
changeset
|
351 */ |
754
5557837fe5b6
Rename some more variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
352 void xs_sidplay1_delete(XSEngineState * state) |
364
421e4fc13bce
More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
353 { |
862
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
354 (void) state; |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
355 } |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
356 |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
357 |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
358 /* This function gets most of the information, though we do miss some |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
359 * (those variables that are only set by libSIDPlay when tune is initialized). |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
360 * Rest of the information is acquired in xs_sidplay1_updateinfo() |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
361 */ |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
362 XSTuneInfo *xs_sidplay1_getinfo(const gchar *filename) |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
363 { |
869
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
364 XSTuneInfo *res = NULL; |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
365 sidTune *tune = NULL; |
862
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
366 sidTuneInfo info; |
869
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
367 guint8 *buf = NULL; |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
368 size_t bufSize; |
862
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
369 |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
370 /* Check if the tune exists and is readable */ |
869
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
371 if (!xs_fload_buffer(filename, &buf, &bufSize, XS_SIDBUF_SIZE, TRUE)) |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
372 { |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
373 XSDEBUG("could not load file '%s'.\n", filename); |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
374 goto error; |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
375 } |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
376 |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
377 if ((tune = new sidTune(buf, bufSize)) == NULL) |
862
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
378 { |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
379 XSDEBUG("could not initialize tune from '%s'.\n", filename); |
869
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
380 goto error; |
862
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
381 } |
74 | 382 |
862
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
383 if (!tune->getStatus()) |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
384 { |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
385 XSDEBUG("tune->getStatus() returned false for '%s'.\n", filename); |
869
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
386 goto error; |
862
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
387 } |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
388 |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
389 /* Get general tune information */ |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
390 tune->getInfo(info); |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
391 |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
392 /* Allocate tuneinfo structure and set information */ |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
393 res = xs_tuneinfo_new(filename, |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
394 info.songs, info.startSong, |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
395 info.infoString[0], info.infoString[1], info.infoString[2], |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
396 info.loadAddr, info.initAddr, info.playAddr, |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
397 info.dataFileLen, info.formatString, |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
398 info.sidModel |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
399 ); |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
400 |
869
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
401 error: |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
402 if (tune) |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
403 delete tune; |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
404 |
3a9bf45178ff
Use xs_fload_buffer() again, to support potential VFS backends.
Matti Hamalainen <ccr@tnsp.org>
parents:
862
diff
changeset
|
405 g_free(buf); |
862
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
406 return res; |
364
421e4fc13bce
More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
407 } |
73
2bc607888f53
Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
72
diff
changeset
|
408 |
2bc607888f53
Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
72
diff
changeset
|
409 |
862
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
410 /* Updates the information of currently playing tune |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
411 */ |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
412 gboolean xs_sidplay1_updateinfo(XSEngineState *state) |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
413 { |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
414 XSSIDPlay1 *engine; |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
415 sidTuneInfo info; |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
416 |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
417 /* Check if we have required structures initialized */ |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
418 if (!state || !state->tuneInfo || !state->internal) |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
419 return FALSE; |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
420 |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
421 engine = (XSSIDPlay1 *) state->internal; |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
422 if (!(engine->tune)) |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
423 return FALSE; |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
424 |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
425 /* Get general tune information */ |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
426 engine->tune->getInfo(info); |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
427 |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
428 /* NOTICE! Here we assume that libSIDPlay[12] headers define |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
429 * SIDTUNE_SIDMODEL_* similarly to our enums in xs_config.h ... |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
430 */ |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
431 state->tuneInfo->sidModel = info.sidModel; |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
432 |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
433 if (state->currSong > 0 && state->currSong <= state->tuneInfo->nsubTunes) |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
434 { |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
435 gint tmpSpeed = info.clockSpeed; |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
436 switch (info.clockSpeed) |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
437 { |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
438 case SIDTUNE_CLOCK_PAL: tmpSpeed = XS_CLOCK_PAL; break; |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
439 case SIDTUNE_CLOCK_NTSC: tmpSpeed = XS_CLOCK_NTSC; break; |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
440 case SIDTUNE_CLOCK_ANY: tmpSpeed = XS_CLOCK_ANY; break; |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
441 case SIDTUNE_CLOCK_UNKNOWN: |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
442 switch (info.songSpeed) |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
443 { |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
444 case SIDTUNE_SPEED_VBI: tmpSpeed = XS_CLOCK_VBI; break; |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
445 case SIDTUNE_SPEED_CIA_1A: tmpSpeed = XS_CLOCK_CIA; break; |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
446 default: tmpSpeed = info.songSpeed; break; |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
447 } |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
448 break; |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
449 } |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
450 state->tuneInfo->subTunes[state->currSong - 1].tuneSpeed = tmpSpeed; |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
451 } |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
452 |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
453 return TRUE; |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
454 } |
011ba70e271e
Major cleanups, make SIDPlayFP backend compile with libSIDPlayFP v1.0.0
Matti Hamalainen <ccr@tnsp.org>
parents:
847
diff
changeset
|
455 |
660
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
456 } /* extern "C" */ |
b0743dc9165d
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
657
diff
changeset
|
457 #endif /* HAVE_SIDPLAY1 */ |