diff --git a/README.md b/README.md index 46e665ec3d4cc..c932920704ab9 100644 --- a/README.md +++ b/README.md @@ -275,6 +275,7 @@ e.g.) YM2151 has 8ch FM sounds, so you can play 8 chords on MIDI 1ch or sharing *** Changes - 5.7.2.3 Fixed VGMPlayer(only) to fix MSM6258. + - Fixed OPM Busy Wait to fix VSIF turboR(FTDI). - 5.7.2.2 Fixed MEGA CD(VSIF Genesis(FTDI)) driver TYPO. - 5.7.2.1 Updated VGMPlayer(only) to fix SCC sounding. - 5.7.2.0 Improved MSX VSIF driver performance. diff --git a/src/VSIF/VGMPlayer/PortWriterMsx.cs b/src/VSIF/VGMPlayer/PortWriterMsx.cs index dace6864bab79..d543455bbb0b6 100644 --- a/src/VSIF/VGMPlayer/PortWriterMsx.cs +++ b/src/VSIF/VGMPlayer/PortWriterMsx.cs @@ -191,7 +191,7 @@ public override void Write(PortWriteData[] data) else if ((dt.Type == 1 || dt.Type == 0xc || //OPLL dt.Type == 4 || dt.Type == 5 || //SCC dt.Type == 0xa || dt.Type == 0xb || //OPL3 - dt.Type == 0xe || //OPM + dt.Type == 0xe || //OPM BUSY WAIT dt.Type == 0x10 || dt.Type == 0x11 || //OPN2 or OPNA dt.Type == 0x12 //OPN ) @@ -213,6 +213,15 @@ public override void Write(PortWriteData[] data) }; ds.AddRange(sd); } + else if (dt.Type >= 0x20) + { + byte[] sd = new byte[5] { + (byte)(dt.Type - 0x20 | 0x20), + (byte)((dt.Address >> 4) | 0x00), (byte)((dt.Address & 0x0f) | 0x10), + (byte)((dt.Data >> 4) | 0x00), (byte)((dt.Data & 0x0f) | 0x10), + }; + ds.AddRange(sd); + } else { byte[] sd = new byte[5] { diff --git a/src/VSIF/VGMPlayer/VGMSong.cs b/src/VSIF/VGMPlayer/VGMSong.cs index ca420b50aacfe..c3b680c8c3648 100644 --- a/src/VSIF/VGMPlayer/VGMSong.cs +++ b/src/VSIF/VGMPlayer/VGMSong.cs @@ -4939,9 +4939,11 @@ protected void deferredWriteOPM(int adrs, int dt) switch (comPortOPM.SoundModuleType) { case VsifSoundModuleType.MSX_FTDI: - case VsifSoundModuleType.TurboR_FTDI: comPortOPM.DeferredWriteData(0xe, (byte)adrs, (byte)dt, (int)Settings.Default.BitBangWaitOPM); break; + case VsifSoundModuleType.TurboR_FTDI: + comPortOPM.DeferredWriteData(0x2e, (byte)adrs, (byte)dt, (int)Settings.Default.BitBangWaitOPM); + break; case VsifSoundModuleType.SpfmLight: case VsifSoundModuleType.Spfm: comPortOPM.DeferredWriteData(0x10, (byte)adrs, (byte)dt, 0); diff --git a/src/mamidimemo/VSIF/PortWriterMsx.cs b/src/mamidimemo/VSIF/PortWriterMsx.cs index dd783bac8eb7b..95b5c7a01b11a 100644 --- a/src/mamidimemo/VSIF/PortWriterMsx.cs +++ b/src/mamidimemo/VSIF/PortWriterMsx.cs @@ -204,7 +204,7 @@ public override void Write(PortWriteData[] data) else if ((dt.Type == 1 || dt.Type == 0xc || //OPLL dt.Type == 4 || dt.Type == 5 || //SCC dt.Type == 0xa || dt.Type == 0xb || //OPL3 - dt.Type == 0xe || //OPM + dt.Type == 0xe || //OPM BUSY WAIT dt.Type == 0x10 || dt.Type == 0x11 //OPN2 ) && lastDataType == dt.Type && (ushort)dt.Address == ((ushort)lastWriteAddress + 1)) @@ -225,6 +225,15 @@ public override void Write(PortWriteData[] data) }; ds.AddRange(sd); } + else if (dt.Type >= 0x20) + { + byte[] sd = new byte[5] { + (byte)(dt.Type - 0x20 | 0x20), + (byte)((dt.Address >> 4) | 0x00), (byte)((dt.Address & 0x0f) | 0x10), + (byte)((dt.Data >> 4) | 0x00), (byte)((dt.Data & 0x0f) | 0x10), + }; + ds.AddRange(sd); + } else { byte[] sd = new byte[5] {