From 8bd4d9e1e46a0e4277e61a7c999de9423df8ef92 Mon Sep 17 00:00:00 2001 From: Mike Pavone Date: Mon, 3 Jun 2013 21:43:38 -0700 Subject: 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. --- psg.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'psg.h') diff --git a/psg.h b/psg.h index be7ca6a..295a319 100644 --- a/psg.h +++ b/psg.h @@ -9,6 +9,7 @@ typedef struct { double buffer_fraction; double buffer_inc; uint32_t buffer_pos; + uint32_t clock_inc; uint32_t cycles; uint32_t samples_frame; uint16_t lsfr; @@ -23,7 +24,7 @@ typedef struct { } psg_context; -void psg_init(psg_context * context, uint32_t sample_rate, uint32_t clock_rate, uint32_t samples_frame); +void psg_init(psg_context * context, uint32_t sample_rate, uint32_t master_clock, uint32_t clock_div, uint32_t samples_frame); void psg_write(psg_context * context, uint8_t value); void psg_run(psg_context * context, uint32_t cycles); -- cgit v1.2.3