Mercurial > repos > blastem
comparison genesis.c @ 2556:6f1eebc0a90b
Add auto option for fm_dac config variable that bases zero offset on the select MD model
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 11 Jan 2025 23:21:36 -0800 |
parents | 3fc8a1f2eb84 |
children | 3f58fec775df |
comparison
equal
deleted
inserted
replaced
2555:78e1769efcdb | 2556:6f1eebc0a90b |
---|---|
2446 render_audio_source_gaindb(gen->psg->audio, config_gain ? atof(config_gain) : 0.0f); | 2446 render_audio_source_gaindb(gen->psg->audio, config_gain ? atof(config_gain) : 0.0f); |
2447 if (gen->header.type != SYSTEM_PICO && gen->header.type != SYSTEM_COPERA) { | 2447 if (gen->header.type != SYSTEM_PICO && gen->header.type != SYSTEM_COPERA) { |
2448 config_gain = tern_find_path(config, "audio\0fm_gain\0", TVAL_PTR).ptrval; | 2448 config_gain = tern_find_path(config, "audio\0fm_gain\0", TVAL_PTR).ptrval; |
2449 render_audio_source_gaindb(gen->ym->audio, config_gain ? atof(config_gain) : 0.0f); | 2449 render_audio_source_gaindb(gen->ym->audio, config_gain ? atof(config_gain) : 0.0f); |
2450 | 2450 |
2451 char *config_dac = tern_find_path_default(config, "audio\0fm_dac\0", (tern_val){.ptrval="zero_offset"}, TVAL_PTR).ptrval; | 2451 char *config_dac = tern_find_path_default(config, "audio\0fm_dac\0", (tern_val){.ptrval="auto"}, TVAL_PTR).ptrval; |
2452 ym_enable_zero_offset(gen->ym, !strcmp(config_dac, "zero_offset")); | 2452 uint8_t zero_offset = 0; |
2453 if (!strcmp(config_dac, "auto")) { | |
2454 zero_offset = gen->ym->status_address_mask != 0; | |
2455 } else if (!strcmp(config_dac, "zero_offset")) { | |
2456 zero_offset = 1; | |
2457 } | |
2458 ym_enable_zero_offset(gen->ym, zero_offset); | |
2453 } | 2459 } |
2454 | 2460 |
2455 if (gen->expansion) { | 2461 if (gen->expansion) { |
2456 segacd_context *cd = gen->expansion; | 2462 segacd_context *cd = gen->expansion; |
2457 config_gain = tern_find_path(config, "audio\0rf5c164_gain\0", TVAL_PTR).ptrval; | 2463 config_gain = tern_find_path(config, "audio\0rf5c164_gain\0", TVAL_PTR).ptrval; |