comparison ym2612.c @ 2302:0343f0d5add0

Fix libretro build for real
author Michael Pavone <pavone@retrodev.com>
date Sun, 12 Mar 2023 20:03:35 -0700
parents 8a918eb95ba8
children
comparison
equal deleted inserted replaced
2301:d30ea441b92e 2302:0343f0d5add0
633 value -= context->zero_offset; 633 value -= context->zero_offset;
634 } 634 }
635 if (context->channels[i].logfile) { 635 if (context->channels[i].logfile) {
636 fwrite(&value, sizeof(value), 1, context->channels[i].logfile); 636 fwrite(&value, sizeof(value), 1, context->channels[i].logfile);
637 } 637 }
638 #ifndef IS_LIB
638 if (context->scope) { 639 if (context->scope) {
639 scope_add_sample(context->scope, context->channels[i].scope_channel, value, context->channels[i].phase_overflow); 640 scope_add_sample(context->scope, context->channels[i].scope_channel, value, context->channels[i].phase_overflow);
640 } 641 }
642 #endif
641 if (context->channels[i].lr & 0x80) { 643 if (context->channels[i].lr & 0x80) {
642 left += (value * context->volume_mult) / context->volume_div; 644 left += (value * context->volume_mult) / context->volume_div;
643 } else if (context->zero_offset) { 645 } else if (context->zero_offset) {
644 if (value >= 0) { 646 if (value >= 0) {
645 left += (context->zero_offset * context->volume_mult) / context->volume_div; 647 left += (context->zero_offset * context->volume_mult) / context->volume_div;
1398 } 1400 }
1399 } 1401 }
1400 1402
1401 void ym_enable_scope(ym2612_context *context, oscilloscope *scope, uint32_t master_clock) 1403 void ym_enable_scope(ym2612_context *context, oscilloscope *scope, uint32_t master_clock)
1402 { 1404 {
1405 #ifndef IS_LIB
1403 static const char *names[] = { 1406 static const char *names[] = {
1404 "YM2612 #1", 1407 "YM2612 #1",
1405 "YM2612 #2", 1408 "YM2612 #2",
1406 "YM2612 #3", 1409 "YM2612 #3",
1407 "YM2612 #4", 1410 "YM2612 #4",
1411 context->scope = scope; 1414 context->scope = scope;
1412 for (int i = 0; i < NUM_CHANNELS; i++) 1415 for (int i = 0; i < NUM_CHANNELS; i++)
1413 { 1416 {
1414 context->channels[i].scope_channel = scope_add_channel(scope, names[i], master_clock / (context->clock_inc * NUM_OPERATORS)); 1417 context->channels[i].scope_channel = scope_add_channel(scope, names[i], master_clock / (context->clock_inc * NUM_OPERATORS));
1415 } 1418 }
1416 } 1419 #endif
1420 }