diff ym2612.c @ 2255:74112041b2c7

Proper calculation of sample rate for YM2612/PSG oscilloscope view
author Michael Pavone <pavone@retrodev.com>
date Mon, 12 Dec 2022 22:26:56 -0800
parents 0d1d5dccdd28
children 5a53a8453241
line wrap: on
line diff
--- a/ym2612.c	Mon Dec 12 21:49:51 2022 -0800
+++ b/ym2612.c	Mon Dec 12 22:26:56 2022 -0800
@@ -1397,7 +1397,7 @@
 	}
 }
 
-void ym_enable_scope(ym2612_context *context, oscilloscope *scope)
+void ym_enable_scope(ym2612_context *context, oscilloscope *scope, uint32_t master_clock)
 {
 	static const char *names[] = {
 		"YM2612 #1",
@@ -1410,7 +1410,6 @@
 	context->scope = scope;
 	for (int i = 0; i < NUM_CHANNELS; i++)
 	{
-		//TODO: calculate actual sample rate based on current clock settings
-		context->channels[i].scope_channel = scope_add_channel(scope, names[i], 53267);
+		context->channels[i].scope_channel = scope_add_channel(scope, names[i], master_clock / (context->clock_inc * NUM_OPERATORS));
 	}
 }