Skip to content

Commit

Permalink
v3.7.3.2 Fixed SoundFont loader for SPC700. Loader could not load 2nd…
Browse files Browse the repository at this point in the history
… and lator samples.
  • Loading branch information
110-kenichi committed Jun 26, 2021
1 parent 7bdade3 commit b92bf01
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 30 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,4 @@ Release(but Debug .NET)
/src/VSIF/VGMPlay_Genesis/.hg/cur-message.txt
/src/VSIF/VGMPlay_NES/VGMPlay_nes.nes
/src/VSIF/VGMPlay_NES/VGMPlay_nes_vrc6.nes
/src/VSIF/VGMPlay_NES/fdsbios.bin
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MAmidiMEmo 3.7.3.1/ Itoken (c)2019, 2020, 2021 / GPL-2.0
MAmidiMEmo 3.7.3.2/ Itoken (c)2019, 2020, 2021 / GPL-2.0

*** What is the MAmidiMEmo? ***

Expand Down Expand Up @@ -268,6 +268,7 @@ e.g.) YM2151 has 8ch FM sounds, so you can play 8 chords on MIDI 1ch or sharing

*** Changes ***

3.7.3.2 Fixed SoundFont loader for SPC700. Loader could not load 2nd and lator samples.
3.7.3.1 Improved square wave low frequency range of VSIF - Famicom.
Added function that can be cleared write cache data when Panic button pressed.
3.7.3.0 Supported VSIF for Famicom.
Expand Down Expand Up @@ -516,3 +517,9 @@ https://github.com/s-macke/SAM

* rpclib - Copyright (c) 2015-2017, Tamás Szelei
https://github.com/rpclib/rpclib

* Minimal NES example using ca65 - Brad Smith
https://github.com/bbbradsmith/NES-ca65-example/tree/fds

* MDFourier - Artemio
https://github.com/ArtemioUrbina/MDFourier
Binary file modified docs/MAmidiMEmo/Manual.pdf
Binary file not shown.
Binary file modified docs/MAmidiMEmo/Manual.pptx
Binary file not shown.
2 changes: 1 addition & 1 deletion src/mamidimemo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static class Program
/// <summary>
///
/// </summary>
public const string FILE_VERSION = "3.7.3.1";
public const string FILE_VERSION = "3.7.3.2";

public const string FILE_COPYRIGHT = @"Virtual chiptune sound MIDI module ""MAmidiMEmo"" Version {0}
Copyright(C) 2019, 2021 Itoken.All rights reserved.";
Expand Down
3 changes: 1 addition & 2 deletions src/mamidimemo/VSIF/PortWriterNesDirect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ private byte[] convertToDataPacket(byte[] sendData)

for (int i = 0; i < sendData.Length; i += 2)
{
//direct
byte adr = (byte)~sendData[i + 0];
byte adr = (byte)~sendData[i + 0]; //DIRECT ADDRESS
byte dat = (byte)~sendData[i + 1];

ret[(i * 2) + 0] = (byte)(0x10 | adr >> 4);
Expand Down
3 changes: 1 addition & 2 deletions src/mamidimemo/VSIF/PortWriterNesIndirect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ private byte[] convertToDataPacket(byte[] sendData)

for (int i = 0; i < sendData.Length; i += 2)
{
//indirect
byte adr = (byte)~(sendData[i + 0] << 1);
byte adr = (byte)~(sendData[i + 0] << 1); //INDIRECT ADDRESS INDEX
byte dat = (byte)~sendData[i + 1];

ret[(i * 2) + 0] = (byte)(0x10 | adr >> 4);
Expand Down
4 changes: 1 addition & 3 deletions src/mamidimemo/VSIF/VsifManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,12 @@ public static VsifClient TryToConnectVSIF(VsifSoundModuleType soundModule, PortI
switch (soundModule)
{
case VsifSoundModuleType.NES_FTDI:
case VsifSoundModuleType.NES_FTDI_FDS:
client = new VsifClient(soundModule, new PortWriterNesDirect(ftdi, comPort));
break;
case VsifSoundModuleType.NES_FTDI_VRC6:
client = new VsifClient(soundModule, new PortWriterNesIndirect(ftdi, comPort));
break;
case VsifSoundModuleType.NES_FTDI_FDS:
client = new VsifClient(soundModule, new PortWriterNesDirect(ftdi, comPort));
break;
}

client.Disposed += Client_Disposed;
Expand Down
38 changes: 19 additions & 19 deletions src/mamidimemo/instruments/Chips/RP2A03.cs
Original file line number Diff line number Diff line change
Expand Up @@ -354,43 +354,43 @@ private void RP2A03WriteData(uint unitNumber, uint address, byte data, bool useC
{
switch (CurrentSoundEngine)
{
case SoundEngineType.VSIF_NES_FTDI_VRC6:
case SoundEngineType.VSIF_NES_FTDI:
switch (address)
{
case uint cmd when 0x0 <= address && address <= 0x15:
lock (vsifLock)
vsifClient.WriteData((byte)address, data, clkWidth);
break;
case uint cmd when 0x9000 <= address && address <= 0x9003:
lock (vsifLock)
vsifClient.WriteData((byte)(24 + cmd & 0x03), data, clkWidth);
break;
case uint cmd when 0xa000 <= address && address <= 0xa003:
lock (vsifLock)
vsifClient.WriteData((byte)(28 + cmd & 0x03), data, clkWidth);
break;
case uint cmd when 0xb000 <= address && address <= 0xb003:
lock (vsifLock)
vsifClient.WriteData((byte)(32 + cmd & 0x03), data, clkWidth);
break;
}
break;
case SoundEngineType.VSIF_NES_FTDI:
case SoundEngineType.VSIF_NES_FTDI_FDS:
switch (address)
{
case uint cmd when 0x0 <= address && address <= 0x15:
case uint cmd when 0x0 <= address && address <= 0xff:
lock (vsifLock)
vsifClient.WriteData((byte)address, data, clkWidth);
break;
}
break;
case SoundEngineType.VSIF_NES_FTDI_FDS:
case SoundEngineType.VSIF_NES_FTDI_VRC6:
switch (address)
{
case uint cmd when 0x0 <= address && address <= 0xff:
case uint cmd when 0x0 <= address && address <= 0x15:
lock (vsifLock)
vsifClient.WriteData((byte)address, data, clkWidth);
break;
case uint cmd when 0x9000 <= address && address <= 0x9003:
lock (vsifLock)
vsifClient.WriteData((byte)(24 + (cmd & 0x03)), data, clkWidth);
break;
case uint cmd when 0xa000 <= address && address <= 0xa003:
lock (vsifLock)
vsifClient.WriteData((byte)(28 + (cmd & 0x03)), data, clkWidth);
break;
case uint cmd when 0xb000 <= address && address <= 0xb003:
lock (vsifLock)
vsifClient.WriteData((byte)(32 + (cmd & 0x03)), data, clkWidth);
break;
}
break;
}
Expand Down Expand Up @@ -2502,8 +2502,8 @@ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContex
var sc = new StandardValuesCollection(new SoundEngineType[] {
SoundEngineType.Software,
SoundEngineType.VSIF_NES_FTDI,
//SoundEngineType.VSIF_NES_FTDI_FDS,
//SoundEngineType.VSIF_NES_FTDI_VRC6,
SoundEngineType.VSIF_NES_FTDI_FDS,
SoundEngineType.VSIF_NES_FTDI_VRC6,
});

return sc;
Expand Down
2 changes: 0 additions & 2 deletions src/mamidimemo/instruments/Chips/SPC700.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2374,8 +2374,6 @@ private void loadPcm(int offset, bool drum)

if (tn == 128)
break;

break;
}
}
if (warningAlign)
Expand Down
8 changes: 8 additions & 0 deletions src/mamidimemo/mamidimemo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,14 @@
<Link>VGMPlay_nes.nes</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\VSIF\VGMPlay_NES\VGMPlay_nes_fds.fds">
<Link>VGMPlay_nes_fds.fds</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\VSIF\VGMPlay_NES\VGMPlay_nes_vrc6.nes">
<Link>VGMPlay_nes_vrc6.nes</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\VSIF\VGMPlay_SMS\VGMPlay_sms.sms">
<Link>VGMPlay_sms.sms</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down

0 comments on commit b92bf01

Please sign in to comment.