game-music-emu: Ym2612_MAME: Fixed internal resampler

From 50198cc90e4b0102c9aa746645dc56141255f1d2 Mon Sep 17 00:00:00 2001
From: Wohlstand <[EMAIL REDACTED]>
Date: Wed, 3 Nov 2021 14:35:10 +0300
Subject: [PATCH] Ym2612_MAME: Fixed internal resampler

When playing files with clock value different than usual, resampler results a wrong pitch
---
 gme/Ym2612_MAME.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gme/Ym2612_MAME.cpp b/gme/Ym2612_MAME.cpp
index 6c3a20e..efe631e 100644
--- a/gme/Ym2612_MAME.cpp
+++ b/gme/Ym2612_MAME.cpp
@@ -2819,7 +2819,7 @@ static void * ym2612_init(void *param, int clock, int rate,
 	F2612->OPN.ST.clock = clock;
 #if RSM_ENABLE
 	F2612->OPN.ST.rate = 53267;
-	F2612->OPN.ST.rateratio = (INT32)(UINT32)((((UINT64)144 * rate) << RSM_FRAC) / clock);
+	F2612->OPN.ST.rateratio = (INT32)(UINT32)((((UINT64)144 * rate) << RSM_FRAC) / 7670454);
 	F2612->OPN.ST.framecnt = 1 << RSM_FRAC;
 	memset(&(F2612->OPN.ST.cur_sample), 0x00, sizeof(FMSAMPLE) * 2);
 	memset(&(F2612->OPN.ST.prev_sample), 0x00, sizeof(FMSAMPLE) * 2);