comparison src/xs_sidplay1.cpp @ 847:5b93bd8c7814

Cleanups, adjust backend configuration sequences, more error checking, improved debug output.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 08 Nov 2012 22:44:36 +0200
parents 5b3e2116408f
children 011ba70e271e
comparison
equal deleted inserted replaced
846:7b11ba6fc4cc 847:5b93bd8c7814
84 { 84 {
85 gint tmpFreq; 85 gint tmpFreq;
86 XSSIDPlay1 *engine; 86 XSSIDPlay1 *engine;
87 assert(state); 87 assert(state);
88 88
89 XSDEBUG("SIDPlay1 backend initializing.\n");
90
89 /* Allocate internal structures */ 91 /* Allocate internal structures */
90 engine = (XSSIDPlay1 *) g_malloc0(sizeof(XSSIDPlay1)); 92 engine = (XSSIDPlay1 *) g_malloc0(sizeof(XSSIDPlay1));
91 if (!engine) return FALSE; 93 if (!engine)
94 return FALSE;
92 95
93 /* Initialize engine */ 96 /* Initialize engine */
94 engine->emu = new emuEngine(); 97 engine->emu = new emuEngine();
95 if (!engine->emu) 98 if (!engine->emu)
96 { 99 {
107 g_free(engine); 110 g_free(engine);
108 return FALSE; 111 return FALSE;
109 } 112 }
110 113
111 state->internal = engine; 114 state->internal = engine;
115
116 XSDEBUG("SIDPlay1 emulation configuration\n");
112 117
113 /* Get current configuration */ 118 /* Get current configuration */
114 engine->emu->getConfig(engine->currConfig); 119 engine->emu->getConfig(engine->currConfig);
115 120
116 /* Configure channel parameters */ 121 /* Configure channel parameters */
256 void xs_sidplay1_close(XSEngineState * state) 261 void xs_sidplay1_close(XSEngineState * state)
257 { 262 {
258 XSSIDPlay1 *engine; 263 XSSIDPlay1 *engine;
259 assert(state); 264 assert(state);
260 265
266 XSDEBUG("SIDPlay1 backend shutdown.\n");
267
261 engine = (XSSIDPlay1 *) state->internal; 268 engine = (XSSIDPlay1 *) state->internal;
262 269
263 /* Free internals */ 270 /* Free internals */
264 if (engine->emu) 271 if (engine->emu)
265 { 272 {