diff psg.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 62177cc39049
children 140af5509ce7
line wrap: on
line diff
--- a/psg.h	Sun Jun 02 22:37:48 2013 -0700
+++ b/psg.h	Mon Jun 03 21:43:38 2013 -0700
@@ -9,6 +9,7 @@
 	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 @@
 } 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);