Mercurial > repos > blastem
comparison vgmplay.c @ 1002:8d032a368dd5
Made low pass filter frequency configurable
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 01 May 2016 13:36:14 -0700 |
parents | 126c0294c1e4 |
children | 22e87b739ad6 |
comparison
equal
deleted
inserted
replaced
1001:1dc749c9c0d9 | 1002:8d032a368dd5 |
---|---|
93 | 93 |
94 uint32_t opts = 0; | 94 uint32_t opts = 0; |
95 if (argc >= 3 && !strcmp(argv[2], "-y")) { | 95 if (argc >= 3 && !strcmp(argv[2], "-y")) { |
96 opts |= YM_OPT_WAVE_LOG; | 96 opts |= YM_OPT_WAVE_LOG; |
97 } | 97 } |
98 | |
99 char * lowpass_cutoff_str = tern_find_path(config, "audio\0lowpass_cutoff\0").ptrval; | |
100 uint32_t lowpass_cutoff = lowpass_cutoff_str ? atoi(lowpass_cutoff_str) : 3390; | |
98 | 101 |
99 ym2612_context y_context; | 102 ym2612_context y_context; |
100 ym_init(&y_context, render_sample_rate(), MCLKS_NTSC, MCLKS_PER_YM, render_audio_buffer(), opts); | 103 ym_init(&y_context, render_sample_rate(), MCLKS_NTSC, MCLKS_PER_YM, render_audio_buffer(), opts, lowpass_cutoff); |
101 | 104 |
102 psg_context p_context; | 105 psg_context p_context; |
103 psg_init(&p_context, render_sample_rate(), MCLKS_NTSC, MCLKS_PER_PSG, render_audio_buffer()); | 106 psg_init(&p_context, render_sample_rate(), MCLKS_NTSC, MCLKS_PER_PSG, render_audio_buffer(), lowpass_cutoff); |
104 | 107 |
105 FILE * f = fopen(argv[1], "rb"); | 108 FILE * f = fopen(argv[1], "rb"); |
106 vgm_header header; | 109 vgm_header header; |
107 fread(&header, sizeof(header), 1, f); | 110 fread(&header, sizeof(header), 1, f); |
108 if (header.version < 0x150 || !header.data_offset) { | 111 if (header.version < 0x150 || !header.data_offset) { |