From 36df8e4aabd5a61c4b0af851763e0d5448efced4 Mon Sep 17 00:00:00 2001 From: goyuken Date: Mon, 24 Sep 2012 17:34:17 +0000 Subject: [PATCH] fix default patch set for VRC7 --- .../Consoles/Nintendo/NES/Boards/VRC7.cs | 2 +- BizHawk.Emulation/Sound/YM2413.cs | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/VRC7.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/VRC7.cs index 6fa75f973e..2f903ab2f0 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/VRC7.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/VRC7.cs @@ -13,7 +13,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo Func remap; //state - BizHawk.Emulation.Sound.YM2413 fm = new Sound.YM2413(); + BizHawk.Emulation.Sound.YM2413 fm = new Sound.YM2413(Sound.YM2413.ChipType.VRC7); ByteBuffer prg_banks_8k = new ByteBuffer(4); ByteBuffer chr_banks_1k = new ByteBuffer(8); diff --git a/BizHawk.Emulation/Sound/YM2413.cs b/BizHawk.Emulation/Sound/YM2413.cs index 2856ccd02f..2711813dfe 100644 --- a/BizHawk.Emulation/Sound/YM2413.cs +++ b/BizHawk.Emulation/Sound/YM2413.cs @@ -19,7 +19,19 @@ namespace BizHawk.Emulation.Sound public YM2413() { MaxVolume = short.MaxValue; - opll = OPLL_new(3579545, 44100); + opll = OPLL_new(3579545, 44100, 0); + } + + public enum ChipType + { + Default = 0, + VRC7 = 1, + YMF281B = 2 + }; + public YM2413(ChipType type) + { + MaxVolume = short.MaxValue; + opll = OPLL_new(3579545, 44100, (int)type); } public void SyncState(Serializer ser) @@ -896,7 +908,7 @@ namespace BizHawk.Emulation.Sound } } - OPLL OPLL_new(uint clk, uint rate) + OPLL OPLL_new(uint clk, uint rate, int type) { OPLL opll = new OPLL(); int i; @@ -909,7 +921,7 @@ namespace BizHawk.Emulation.Sound opll.mask = 0; OPLL_reset(opll); - OPLL_reset_patch(opll, 0); + OPLL_reset_patch(opll, type); return opll; }