diff psg.h @ 483:3e1573fa22cf

Implement turbo/slow motion feature that overclocks or underclocks the entire system at the push of a button
author Mike Pavone <pavone@retrodev.com>
date Tue, 01 Oct 2013 23:51:16 -0700
parents 140af5509ce7
children 9a5dc22297f2
line wrap: on
line diff
--- a/psg.h	Wed Sep 18 19:10:54 2013 -0700
+++ b/psg.h	Tue Oct 01 23:51:16 2013 -0700
@@ -1,6 +1,6 @@
 /*
  Copyright 2013 Michael Pavone
- This file is part of BlastEm. 
+ This file is part of BlastEm.
  BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text.
 */
 #ifndef PSG_CONTEXT_H_
@@ -11,11 +11,12 @@
 typedef struct {
 	int16_t  *audio_buffer;
 	int16_t  *back_buffer;
-	double   buffer_fraction;
-	double   buffer_inc;
+	uint64_t buffer_fraction;
+	uint64_t buffer_inc;
 	uint32_t buffer_pos;
 	uint32_t clock_inc;
 	uint32_t cycles;
+	uint32_t sample_rate;
 	uint32_t samples_frame;
 	uint16_t lsfr;
 	uint16_t counter_load[4];
@@ -30,6 +31,7 @@
 
 
 void psg_init(psg_context * context, uint32_t sample_rate, uint32_t master_clock, uint32_t clock_div, uint32_t samples_frame);
+void psg_adjust_master_clock(psg_context * context, uint32_t master_clock);
 void psg_write(psg_context * context, uint8_t value);
 void psg_run(psg_context * context, uint32_t cycles);