Mercurial > repos > blastem
comparison sms.c @ 1796:51417bb557b6
Configurable gain for overall output and individual components
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 23 Mar 2019 17:18:10 -0700 |
parents | 6e4faa10f9ee |
children | 49f65d240299 2d462aa78349 |
comparison
equal
deleted
inserted
replaced
1795:a02b4ed940b6 | 1796:51417bb557b6 |
---|---|
565 | 565 |
566 static void keyboard_up(system_header *system, uint8_t scancode) | 566 static void keyboard_up(system_header *system, uint8_t scancode) |
567 { | 567 { |
568 sms_context *sms = (sms_context *)system; | 568 sms_context *sms = (sms_context *)system; |
569 io_keyboard_up(&sms->io, scancode); | 569 io_keyboard_up(&sms->io, scancode); |
570 } | |
571 | |
572 static void set_gain_config(sms_context *sms) | |
573 { | |
574 char *config_gain; | |
575 config_gain = tern_find_path(config, "audio\0psg_gain\0", TVAL_PTR).ptrval; | |
576 render_audio_source_gaindb(sms->psg->audio, config_gain ? atof(config_gain) : 0.0f); | |
570 } | 577 } |
571 | 578 |
572 static void config_updated(system_header *system) | 579 static void config_updated(system_header *system) |
573 { | 580 { |
574 sms_context *sms = (sms_context *)system; | 581 sms_context *sms = (sms_context *)system; |
618 sms->normal_clock = sms->master_clock = 53693175; | 625 sms->normal_clock = sms->master_clock = 53693175; |
619 | 626 |
620 sms->psg = malloc(sizeof(psg_context)); | 627 sms->psg = malloc(sizeof(psg_context)); |
621 psg_init(sms->psg, sms->master_clock, 15*16); | 628 psg_init(sms->psg, sms->master_clock, 15*16); |
622 | 629 |
630 set_gain_config(sms); | |
631 | |
623 sms->vdp = init_vdp_context(0); | 632 sms->vdp = init_vdp_context(0); |
624 sms->vdp->system = &sms->header; | 633 sms->vdp->system = &sms->header; |
625 | 634 |
626 sms->header.info.save_type = SAVE_NONE; | 635 sms->header.info.save_type = SAVE_NONE; |
627 sms->header.info.name = strdup(media->name); | 636 sms->header.info.name = strdup(media->name); |