Skip to content

Commit

Permalink
- Fixed OPM Busy Wait to fix VSIF turboR(FTDI).
Browse files Browse the repository at this point in the history
  • Loading branch information
110-kenichi committed Nov 7, 2024
1 parent 5e29576 commit 610319d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
11 changes: 10 additions & 1 deletion src/VSIF/VGMPlayer/PortWriterMsx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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] {
Expand Down
4 changes: 3 additions & 1 deletion src/VSIF/VGMPlayer/VGMSong.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
11 changes: 10 additions & 1 deletion src/mamidimemo/VSIF/PortWriterMsx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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] {
Expand Down

0 comments on commit 610319d

Please sign in to comment.