Mercurial > repos > blastem
diff ym2612.h @ 380:1c8d74f2ab0b
Make the PSG and YM2612 use the master clock internal with an increment based on clock divider so that they stay perflectly in sync. Run both the PSG and YM2612 whenver one of them needs to be run.
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 03 Jun 2013 21:43:38 -0700 |
parents | 0f8a759f1ff4 |
children | 72933100c55c |
line wrap: on
line diff
--- a/ym2612.h Sun Jun 02 22:37:48 2013 -0700 +++ b/ym2612.h Mon Jun 03 21:43:38 2013 -0700 @@ -39,6 +39,7 @@ int16_t *back_buffer; double buffer_fraction; double buffer_inc; + uint32_t clock_inc; uint32_t buffer_pos; uint32_t sample_limit; uint32_t current_cycle; @@ -59,7 +60,7 @@ uint8_t selected_part; } ym2612_context; -void ym_init(ym2612_context * context, uint32_t sample_rate, uint32_t clock_rate, uint32_t sample_limit); +void ym_init(ym2612_context * context, uint32_t sample_rate, uint32_t master_clock, uint32_t clock_div, uint32_t sample_limit); void ym_run(ym2612_context * context, uint32_t to_cycle); void ym_address_write_part1(ym2612_context * context, uint8_t address); void ym_address_write_part2(ym2612_context * context, uint8_t address);