Skip to content

Commit

Permalink
- 5.7.2.3 Fixed VGMPlayer(only) to fix MSM6258.
Browse files Browse the repository at this point in the history
  • Loading branch information
110-kenichi committed Nov 7, 2024
1 parent 3f37b6c commit 5e29576
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 37 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MAmidiMEmo 5.7.7.2 Itoken (c)2019, 2024 / GPL-2.0
MAmidiMEmo 5.7.7.3 Itoken (c)2019, 2024 / GPL-2.0

*** What is the MAmidiMEmo? ***

Expand Down Expand Up @@ -274,6 +274,7 @@ e.g.) YM2151 has 8ch FM sounds, so you can play 8 chords on MIDI 1ch or sharing
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SNQ9JE3JAQMNQ)

*** Changes
- 5.7.2.3 Fixed VGMPlayer(only) to fix MSM6258.
- 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.
Expand Down
64 changes: 32 additions & 32 deletions src/VSIF/VGMPlayer/DacStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ internal class DacStream : IDisposable
private SongBase parentSong;

private VsifClient comPortOPN2 = null;
private VsifClient comPortOPN2ProxyOrTurboRDac = null;
private VsifClient comPortOPNAProxyOrTurboRDac = null;
private OKIM6258 okim6258 = null;
private VsifClient comPortNES = null;

public DacStream(SongBase parentSong, VsifClient comPortOPN2, VsifClient comPortOPN2ProxyOrTurboRDac, OKIM6258 okim6258, VsifClient comPortNES)
public DacStream(SongBase parentSong, VsifClient comPortOPN2, VsifClient comPortOPNAProxyOrTurboRDac, OKIM6258 okim6258, VsifClient comPortNES)
{
this.parentSong = parentSong;

this.comPortOPN2 = comPortOPN2;
this.comPortOPN2ProxyOrTurboRDac = comPortOPN2ProxyOrTurboRDac;
this.comPortOPNAProxyOrTurboRDac = comPortOPNAProxyOrTurboRDac;
this.okim6258 = okim6258;
this.comPortNES = comPortNES;
}
Expand Down Expand Up @@ -129,16 +129,16 @@ public void StreamSong()
{
parentSong.DeferredWriteOPN2_DAC(comPortOPN2, data);
}
else if (comPortOPN2ProxyOrTurboRDac != null)
else if (comPortOPNAProxyOrTurboRDac != null)
{
if (comPortOPN2ProxyOrTurboRDac.Tag.ContainsKey("ProxyOPN2"))
if (comPortOPNAProxyOrTurboRDac.Tag.ContainsKey("ProxyOKIM6258"))
{
data = (byte)Math.Round((double)data * (double)Settings.Default.DacVolume / 100d);
parentSong.DeferredWriteOPNA_PseudoDAC(comPortOPN2ProxyOrTurboRDac, data);
parentSong.DeferredWriteOPNA_PseudoDAC(comPortOPNAProxyOrTurboRDac, data);
}
else if (comPortOPN2ProxyOrTurboRDac.SoundModuleType == VsifSoundModuleType.TurboR_FTDI)
else if (comPortOPNAProxyOrTurboRDac.SoundModuleType == VsifSoundModuleType.TurboR_FTDI)
{
parentSong.DeferredWriteTurboR_DAC(comPortOPN2ProxyOrTurboRDac, data);
parentSong.DeferredWriteTurboR_DAC(comPortOPNAProxyOrTurboRDac, data);
}
}
sampleRate = pd.CurrentStreamData.Frequency;
Expand All @@ -158,24 +158,24 @@ public void StreamSong()
{
var ddata = okim6258.decode(data & 0xf);
ddata = (int)Math.Round((double)ddata * (double)Settings.Default.DacVolume / 100d);

if (comPortOPN2 != null && comPortOPN2.Tag.ContainsKey("ProxyOKIM6258"))
{
byte bdata = (byte)((ddata >> 8) + 128);
parentSong.DeferredWriteOPN2_DAC(comPortOPN2, bdata);
}
else if (comPortOPN2ProxyOrTurboRDac != null)
if (comPortOPNAProxyOrTurboRDac != null)
{
if (comPortOPN2ProxyOrTurboRDac.Tag.ContainsKey("ProxyOPN2"))
if (comPortOPNAProxyOrTurboRDac.SoundModuleType == VsifSoundModuleType.TurboR_FTDI)
{
byte bdata = (byte)((ddata >> 8));
parentSong.DeferredWriteOPNA_DAC(comPortOPN2ProxyOrTurboRDac, bdata);
byte bdata = (byte)((ddata >> 8) + 128);
parentSong.DeferredWriteTurboR_DAC(comPortOPNAProxyOrTurboRDac, bdata);
}
else if (comPortOPN2ProxyOrTurboRDac.SoundModuleType == VsifSoundModuleType.TurboR_FTDI)
else if (comPortOPNAProxyOrTurboRDac.Tag.ContainsKey("ProxyOKIM6258"))
{
parentSong.DeferredWriteTurboR_DAC(comPortOPN2ProxyOrTurboRDac, data);
byte bdata = (byte)((ddata >> 8));
parentSong.DeferredWriteOPNA_DAC(comPortOPNAProxyOrTurboRDac, bdata);
}
}
else if (comPortOPN2 != null && comPortOPN2.Tag.ContainsKey("ProxyOKIM6258"))
{
byte bdata = (byte)((ddata >> 8) + 128);
parentSong.DeferredWriteOPN2_DAC(comPortOPN2, bdata);
}
pd.StreamIdx -= pd.StreamIdxDir;
pd.Oki6285Adpcm2ndNibble = true;
}
Expand All @@ -186,24 +186,24 @@ public void StreamSong()

ddata = (int)Math.Round((double)ddata * (double)Settings.Default.DacVolume / 100d);

if (comPortOPN2 != null && comPortOPN2.Tag.ContainsKey("ProxyOKIM6258"))
if (comPortOPNAProxyOrTurboRDac != null)
{
byte bdata = (byte)((ddata >> 8) + 128);
parentSong.DeferredWriteOPN2_DAC(comPortOPN2, bdata);
}
else if (comPortOPN2ProxyOrTurboRDac != null)
{
if (comPortOPN2ProxyOrTurboRDac.Tag.ContainsKey("ProxyOPN2"))
if (comPortOPNAProxyOrTurboRDac.SoundModuleType == VsifSoundModuleType.TurboR_FTDI)
{
byte bdata = (byte)((ddata >> 8));
parentSong.DeferredWriteOPNA_DAC(comPortOPN2ProxyOrTurboRDac, bdata);
byte bdata = (byte)((ddata >> 8) + 128);
parentSong.DeferredWriteTurboR_DAC(comPortOPNAProxyOrTurboRDac, bdata);
}
else if (comPortOPN2ProxyOrTurboRDac.SoundModuleType == VsifSoundModuleType.TurboR_FTDI)
else if (comPortOPNAProxyOrTurboRDac.Tag.ContainsKey("ProxyOKIM6258"))
{
byte bdata = (byte)((ddata >> 8) + 128);
parentSong.DeferredWriteTurboR_DAC(comPortOPN2ProxyOrTurboRDac, bdata);
byte bdata = (byte)((ddata >> 8));
parentSong.DeferredWriteOPNA_DAC(comPortOPNAProxyOrTurboRDac, bdata);
}
}
else if (comPortOPN2 != null && comPortOPN2.Tag.ContainsKey("ProxyOKIM6258"))
{
byte bdata = (byte)((ddata >> 8) + 128);
parentSong.DeferredWriteOPN2_DAC(comPortOPN2, bdata);
}
pd.Oki6285Adpcm2ndNibble = false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/VSIF/VGMPlayer/FormMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions src/VSIF/VGMPlayer/VGMSong.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3855,7 +3855,6 @@ protected override void StreamSong()
if (!oki6285Adpcm2ndNibble)
{
var ddata = okim6258.decode(dd & 0xf);
//var ddata = decodeOpnaAdpcm(dd & 0xf);
ddata = (int)Math.Round((double)ddata * (double)Settings.Default.DacVolume / 100d);

if (comPortTurboRProxy != null && comPortTurboRProxy.Tag.ContainsKey("ProxyOKIM6258"))
Expand Down Expand Up @@ -4161,12 +4160,12 @@ protected override void StreamSong()
currentStreamParam = streamParam;
if (currentStreamParam == null)
{
dacStream.Stop();
dacStream?.Stop();
}
else
{
currentStreamData = streamTable[currentStreamParam.StreamID];
dacStream.Play(currentStreamParam, currentStreamData, streamChipType, dacData);
dacStream?.Play(currentStreamParam, currentStreamData, streamChipType, dacData);
}
}
}
Expand Down

0 comments on commit 5e29576

Please sign in to comment.