annotate src/xs_sidplay2.cc @ 402:f997b79a7251

More work on merging of improved STIL/SLDB handling code with completely dynamic memory allocation.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 01 Jun 2006 02:18:02 +0000
parents 0a60ef2b5ab0
children 7f694e5a1493
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 /*
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 XMMS-SID - SIDPlay input plugin for X MultiMedia System (XMMS)
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 libSIDPlay v2 support
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5
324
dd201740a720 Changed copyright text.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
6 Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org>
dd201740a720 Changed copyright text.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
7 (C) Copyright 1999-2005 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
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19 You should have received a copy of the GNU General Public License
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 along with this program; if not, write to the Free Software
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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"
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 #include <stdio.h>
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 #include "xs_config.h"
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 #include "xs_support.h"
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
31
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33 #include <sidplay/sidplay2.h>
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 #ifdef HAVE_RESID_BUILDER
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 #include <sidplay/builders/resid.h>
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 #endif
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 #ifdef HAVE_HARDSID_BUILDER
75
653c9b0d1320 SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents: 74
diff changeset
38 #include <sidplay/builders/hardsid.h>
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39 #endif
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41
396
0a60ef2b5ab0 Cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 394
diff changeset
42 typedef struct {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
43 sidplay2 *currEng;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
44 sidbuilder *currBuilder;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
45 sid2_config_t currConfig;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
46 SidTune *currTune;
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 } t_xs_sidplay2;
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
50 /* We need to 'export' all this pseudo-C++ crap */
396
0a60ef2b5ab0 Cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 394
diff changeset
51 extern "C" {
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52
75
653c9b0d1320 SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents: 74
diff changeset
53
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
54 /* 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
55 */
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
56 gboolean xs_sidplay2_isourfile(gchar * pcFilename)
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
57 {
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
58 SidTune *testTune = new SidTune(pcFilename);
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
59
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
60 if (!testTune) return FALSE;
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
61
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
62 if (!testTune->getStatus()) {
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
63 delete testTune;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
64 return FALSE;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
65 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
66
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
67 delete testTune;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
68 return TRUE;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
69 }
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
72
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
73 /* Initialize SIDPlay2
75
653c9b0d1320 SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents: 74
diff changeset
74 */
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
75 gboolean xs_sidplay2_init(t_xs_status * myStatus)
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
76 {
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
77 gint tmpFreq;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
78 t_xs_sidplay2 *myEngine;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
79 assert(myStatus);
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
81 /* Allocate internal structures */
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
82 myEngine = (t_xs_sidplay2 *) g_malloc0(sizeof(t_xs_sidplay2));
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
83 myStatus->sidEngine = myEngine;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
84 if (!myEngine) return FALSE;
75
653c9b0d1320 SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents: 74
diff changeset
85
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
86 /* Initialize the engine */
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
87 myEngine->currEng = new sidplay2;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
88 if (!myEngine->currEng) {
394
7c4216c7aa47 XSERR -> xs_error fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 371
diff changeset
89 xs_error("Could not initialize libSIDPlay2 emulation engine\n");
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
90 return FALSE;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
91 }
75
653c9b0d1320 SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents: 74
diff changeset
92
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
93 /* Get current configuration */
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
94 myEngine->currConfig = myEngine->currEng->config();
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
95
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
96 /* Configure channels and stuff */
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
97 switch (myStatus->audioChannels) {
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
99 case XS_CHN_AUTOPAN:
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
100 myEngine->currConfig.playback = sid2_stereo;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
101 break;
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
102
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
103 case XS_CHN_STEREO:
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
104 myEngine->currConfig.playback = sid2_stereo;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
105 break;
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
106
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
107 case XS_CHN_MONO:
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
108 default:
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
109 myEngine->currConfig.playback = sid2_mono;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
110 myStatus->audioChannels = XS_CHN_MONO;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
111 break;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
112 }
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
113
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
114
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
115 /* Memory mode settings */
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
116 switch (xs_cfg.memoryMode) {
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
117 case XS_MPU_BANK_SWITCHING:
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
118 myEngine->currConfig.environment = sid2_envBS;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
119 break;
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
120
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
121 case XS_MPU_TRANSPARENT_ROM:
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
122 myEngine->currConfig.environment = sid2_envTP;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
123 break;
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
124
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
125 case XS_MPU_PLAYSID_ENVIRONMENT:
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
126 myEngine->currConfig.environment = sid2_envPS;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
127 break;
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
128
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
129 case XS_MPU_REAL:
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
130 default:
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
131 myEngine->currConfig.environment = sid2_envR;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
132 xs_cfg.memoryMode = XS_MPU_REAL;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
133 break;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
134 }
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
135
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
136
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
137 /* Audio parameters sanity checking and setup */
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
138 myEngine->currConfig.precision = myStatus->audioBitsPerSample;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
139 tmpFreq = myStatus->audioFrequency;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
140
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
141 if (myStatus->oversampleEnable)
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
142 tmpFreq = (tmpFreq * myStatus->oversampleFactor);
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
143
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
144 myEngine->currConfig.frequency = tmpFreq;
74
8cb66a3f75f7 Testing
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
145
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
146 switch (myStatus->audioBitsPerSample) {
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
147 case XS_RES_8BIT:
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
148 myStatus->audioFormat = FMT_U8;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
149 myEngine->currConfig.sampleFormat = SID2_LITTLE_UNSIGNED;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
150 break;
127
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 103
diff changeset
151
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
152 case XS_RES_16BIT:
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
153 default:
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
154 switch (myStatus->audioFormat) {
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
155 case FMT_U16_LE:
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
156 myEngine->currConfig.sampleFormat = SID2_LITTLE_UNSIGNED;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
157 break;
127
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 103
diff changeset
158
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
159 case FMT_U16_BE:
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
160 myEngine->currConfig.sampleFormat = SID2_BIG_UNSIGNED;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
161 break;
127
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 103
diff changeset
162
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
163 case FMT_U16_NE:
74
8cb66a3f75f7 Testing
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
164 #ifdef WORDS_BIGENDIAN
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
165 myEngine->currConfig.sampleFormat = SID2_BIG_UNSIGNED;
74
8cb66a3f75f7 Testing
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
166 #else
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
167 myEngine->currConfig.sampleFormat = SID2_LITTLE_UNSIGNED;
74
8cb66a3f75f7 Testing
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
168 #endif
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
169 break;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
170
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
171 case FMT_S16_LE:
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
172 myEngine->currConfig.sampleFormat = SID2_LITTLE_SIGNED;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
173 break;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
174
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
175 case FMT_S16_BE:
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
176 myEngine->currConfig.sampleFormat = SID2_BIG_SIGNED;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
177 break;
127
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 103
diff changeset
178
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
179 default:
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
180 myStatus->audioFormat = FMT_S16_NE;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
181 #ifdef WORDS_BIGENDIAN
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
182 myEngine->currConfig.sampleFormat = SID2_BIG_SIGNED;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
183 #else
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
184 myEngine->currConfig.sampleFormat = SID2_LITTLE_SIGNED;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
185 #endif
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
186 break;
127
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 103
diff changeset
187
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
188 }
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
189 break;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
190 }
352
2b4ca75b999f Cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
191
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
192 /* Initialize builder object */
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
193 XSDEBUG("init builder #%i, maxsids=%i\n", xs_cfg.sid2Builder, (myEngine->currEng->info()).maxsids);
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
194 #ifdef HAVE_RESID_BUILDER
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
195 if (xs_cfg.sid2Builder == XS_BLD_RESID) {
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
196 ReSIDBuilder *rs = new ReSIDBuilder("ReSID builder");
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
197 myEngine->currBuilder = (sidbuilder *) rs;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
198 if (rs) {
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
199 /* Builder object created, initialize it */
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
200 rs->create((myEngine->currEng->info()).maxsids);
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
201 if (!*rs) {
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
202 xs_error("rs->create() failed.\n");
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
203 return FALSE;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
204 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
205
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
206 rs->filter(xs_cfg.emulateFilters);
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
207 if (!*rs) {
394
7c4216c7aa47 XSERR -> xs_error fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 371
diff changeset
208 xs_error("rs->filter(%d) failed.\n", xs_cfg.emulateFilters);
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
209 return FALSE;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
210 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
211
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
212 // FIXME FIX ME: support other configurable parameters ...
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
213 // ... WHEN/IF resid-builder+libsidplay2 gets fixed
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
214 rs->sampling(tmpFreq);
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
215 if (!*rs) {
394
7c4216c7aa47 XSERR -> xs_error fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 371
diff changeset
216 xs_error("rs->sampling(%d) failed.\n", tmpFreq);
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
217 return FALSE;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
218 }
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
219
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
220 // FIXME FIX ME: load filter spec
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
221 rs->filter((sid_filter_t *) NULL);
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
222 if (!*rs) {
394
7c4216c7aa47 XSERR -> xs_error fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 371
diff changeset
223 xs_error("rs->filter(NULL) failed.\n");
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
224 return FALSE;
321
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
225 }
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
226 }
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
227 }
321
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
228 #endif
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
229 #ifdef HAVE_HARDSID_BUILDER
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
230 if (xs_cfg.sid2Builder == XS_BLD_HARDSID) {
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
231 HardSIDBuilder *hs = new HardSIDBuilder("HardSID builder");
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
232 myEngine->currBuilder = (sidbuilder *) hs;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
233 if (hs) {
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
234 /* Builder object created, initialize it */
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
235 hs->create((myEngine->currEng->info()).maxsids);
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
236 if (!*hs) {
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
237 xs_error("hs->create() failed.\n");
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
238 return FALSE;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
239 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
240
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
241 hs->filter(xs_cfg.emulateFilters);
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
242 if (!*hs) {
394
7c4216c7aa47 XSERR -> xs_error fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 371
diff changeset
243 xs_error("hs->filter(%d) failed.\n", xs_cfg.emulateFilters);
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
244 return FALSE;
321
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
245 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
246 }
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
247 }
321
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
248 #endif
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
249
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
250 if (!myEngine->currBuilder) {
394
7c4216c7aa47 XSERR -> xs_error fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 371
diff changeset
251 xs_error("Could not initialize SIDBuilder object.\n");
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
252 return FALSE;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
253 }
321
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
254
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
255 XSDEBUG("%s\n", myEngine->currBuilder->credits());
321
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
256
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
257
366
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
258 /* Clockspeed settings */
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
259 switch (xs_cfg.clockSpeed) {
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
260 case XS_CLOCK_NTSC:
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
261 myEngine->currConfig.clockDefault = SID2_CLOCK_NTSC;
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
262 break;
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
263
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
264 default:
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
265 xs_error("Invalid clockSpeed=%d, falling back to PAL.\n", xs_cfg.clockSpeed);
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
266
366
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
267 case XS_CLOCK_PAL:
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
268 myEngine->currConfig.clockDefault = SID2_CLOCK_PAL;
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
269 xs_cfg.clockSpeed = XS_CLOCK_PAL;
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
270 break;
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
271 }
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
272
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
273
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
274 /* Configure rest of the emulation */
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
275 myEngine->currConfig.sidEmulation = myEngine->currBuilder;
371
75f51962c083 Emulation engine setup fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 367
diff changeset
276
75f51962c083 Emulation engine setup fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 367
diff changeset
277 if (xs_cfg.forceSpeed) {
75f51962c083 Emulation engine setup fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 367
diff changeset
278 myEngine->currConfig.clockForced = true;
75f51962c083 Emulation engine setup fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 367
diff changeset
279 myEngine->currConfig.clockSpeed = myEngine->currConfig.clockDefault;
75f51962c083 Emulation engine setup fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 367
diff changeset
280 } else {
75f51962c083 Emulation engine setup fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 367
diff changeset
281 myEngine->currConfig.clockForced = false;
75f51962c083 Emulation engine setup fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 367
diff changeset
282 myEngine->currConfig.clockSpeed = SID2_CLOCK_CORRECT;
75f51962c083 Emulation engine setup fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 367
diff changeset
283 }
366
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
284
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
285 if ((xs_cfg.sid2OptLevel >= 0) && (xs_cfg.sid2OptLevel <= SID2_MAX_OPTIMISATION))
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
286 myEngine->currConfig.optimisation = xs_cfg.sid2OptLevel;
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
287 else {
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
288 xs_error("Invalid sid2OptLevel=%d, falling back to %d.\n",
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
289 xs_cfg.sid2OptLevel, SID2_DEFAULT_OPTIMISATION);
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
290
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
291 xs_cfg.sid2OptLevel =
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
292 myEngine->currConfig.optimisation = SID2_DEFAULT_OPTIMISATION;
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
293 }
366
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
294
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
295 if (xs_cfg.mos8580)
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
296 myEngine->currConfig.sidDefault = SID2_MOS8580;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
297 else
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
298 myEngine->currConfig.sidDefault = SID2_MOS6581;
321
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
299
366
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
300 if (xs_cfg.forceModel)
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
301 myEngine->currConfig.sidModel = myEngine->currConfig.sidDefault;
371
75f51962c083 Emulation engine setup fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 367
diff changeset
302 else
75f51962c083 Emulation engine setup fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 367
diff changeset
303 myEngine->currConfig.sidModel = SID2_MODEL_CORRECT;
366
29c4484f1de2 Fixes in emulator engine configuration, make 'forceModel' option work.
Matti Hamalainen <ccr@tnsp.org>
parents: 364
diff changeset
304
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
305 /* XXX: Should this be configurable? libSIDPlay1 does not support it, though */
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
306 myEngine->currConfig.sidSamples = TRUE;
321
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
307
45ad9f7c1628 Improved compatibility, some fixes in reSID emulation initialization.
Matti Hamalainen <ccr@tnsp.org>
parents: 270
diff changeset
308
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
309 /* Now set the emulator configuration */
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
310 if (myEngine->currEng->config(myEngine->currConfig) < 0) {
394
7c4216c7aa47 XSERR -> xs_error fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 371
diff changeset
311 xs_error("Emulator engine configuration failed!\n");
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
312 return FALSE;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
313 }
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
314
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
315 /* Create the sidtune */
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
316 myEngine->currTune = new SidTune(0);
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
317 if (!myEngine->currTune) {
394
7c4216c7aa47 XSERR -> xs_error fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 371
diff changeset
318 xs_error("Could not initialize SIDTune object.\n");
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
319 return FALSE;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
320 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
321
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
322 return TRUE;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
323 }
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
324
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
325
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
326 /* Close SIDPlay2 engine
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
327 */
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
328 void xs_sidplay2_close(t_xs_status * myStatus)
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
329 {
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
330 t_xs_sidplay2 *myEngine;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
331 assert(myStatus);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
332
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
333 myEngine = (t_xs_sidplay2 *) myStatus->sidEngine;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
334
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
335 /* Free internals */
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
336 if (myEngine->currBuilder) {
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
337 delete myEngine->currBuilder;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
338 myEngine->currBuilder = NULL;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
339 }
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
340
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
341 if (myEngine->currEng) {
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
342 delete myEngine->currEng;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
343 myEngine->currEng = NULL;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
344 }
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
345
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
346 if (myEngine->currTune) {
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
347 delete myEngine->currTune;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
348 myEngine->currTune = NULL;
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
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
351 xs_sidplay2_deletesid(myStatus);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
352
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
353 g_free(myEngine);
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
354 myStatus->sidEngine = NULL;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
355 }
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
356
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
357
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
358 /* Initialize current song and sub-tune
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
359 */
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
360 gboolean xs_sidplay2_initsong(t_xs_status * myStatus)
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
361 {
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
362 t_xs_sidplay2 *myEngine;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
363 assert(myStatus);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
364
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
365 myEngine = (t_xs_sidplay2 *) myStatus->sidEngine;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
366 if (!myEngine) return FALSE;
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
367
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
368 if (!myEngine->currTune->selectSong(myStatus->currSong)) {
394
7c4216c7aa47 XSERR -> xs_error fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 371
diff changeset
369 xs_error("currTune->selectSong() failed\n");
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
370 return FALSE;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
371 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
372
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
373 if (myEngine->currEng->load(myEngine->currTune) < 0) {
394
7c4216c7aa47 XSERR -> xs_error fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 371
diff changeset
374 xs_error("currEng->load() failed\n");
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
375 return FALSE;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
376 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
377
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
378 return TRUE;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
379 }
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
380
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 /* 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
383 */
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
384 guint xs_sidplay2_fillbuffer(t_xs_status * myStatus, gchar * audioBuffer, guint audioBufSize)
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
385 {
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
386 t_xs_sidplay2 *myEngine;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
387 assert(myStatus);
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
388
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
389 myEngine = (t_xs_sidplay2 *) myStatus->sidEngine;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
390 if (!myEngine) return 0;
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
391
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
392 return myEngine->currEng->play(audioBuffer, audioBufSize);
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 */
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
398 gboolean xs_sidplay2_loadsid(t_xs_status * myStatus, gchar * pcFilename)
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
399 {
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
400 t_xs_sidplay2 *myEngine;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
401 assert(myStatus);
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
402
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
403 myEngine = (t_xs_sidplay2 *) myStatus->sidEngine;
367
8338cc14bbdb Check for myEngine != NULL
Matti Hamalainen <ccr@tnsp.org>
parents: 366
diff changeset
404 if (!myEngine) return FALSE;
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
405
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
406 /* Try to get the tune */
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
407 if (!pcFilename) return FALSE;
367
8338cc14bbdb Check for myEngine != NULL
Matti Hamalainen <ccr@tnsp.org>
parents: 366
diff changeset
408
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
409 if (!myEngine->currTune->load(pcFilename))
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
410 return FALSE;
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
411
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
412 return TRUE;
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
413 }
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
414
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 /* Delete INTERNAL information
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
417 */
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
418 void xs_sidplay2_deletesid(t_xs_status * myStatus)
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
419 {
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
420 assert(myStatus);
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
421
364
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
422 /* With the current scheme of handling sidtune-loading, we don't do anything here. */
421e4fc13bce More and more of indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
423 }
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
424
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
425
270
583f5651abff Cleanups, moved engine configuration to initialization function.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
426 /* Return song information
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
427 */
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 127
diff changeset
428 #define TFUNCTION xs_sidplay2_getsidinfo
87
94497283affa Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 78
diff changeset
429 #define TTUNEINFO SidTuneInfo
94497283affa Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 78
diff changeset
430 #define TTUNE SidTune
94497283affa Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 78
diff changeset
431 #include "xs_sidplay.h"
73
2bc607888f53 Added libsidplay2 module, lots of reworking of internals, sidplay1 support
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
432
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
433 } /* extern "C" */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 352
diff changeset
434 #endif /* HAVE_SIDPLAY2 */