Skip to content

Commit 26af839

Browse files
committed
- 6.2.1.0 Supported MSXπ UART(i8251) for MAmidiMemo
- Slightly may improved transfer speed MSXπ UART(i8251)
1 parent c332162 commit 26af839

File tree

6 files changed

+207
-252
lines changed

6 files changed

+207
-252
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ e.g.) YM2151 has 8ch FM sounds, so you can play 8 chords on MIDI 1ch or sharing
278278
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SNQ9JE3JAQMNQ)
279279

280280
*** Changes
281+
- 6.2.1.0 Supported MSXπ UART(i8251) for MAmidiMemo
282+
- Slightly may improved transfer speed MSXπ UART(i8251)
281283
- 6.2.0.1 Fixed OPNB wait for MSXπ UART(i8251).
282284
- 6.2.0.0 Supported MSXπ UART(i8251).
283285
- Use VGMPlay_mpi.rom (or VGMPlay_mpi_Vkey.rom)

src/VSIF/VGMPlayer/FormMain.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/VSIF/VGMPlayer/VGMSong.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
using System.Windows.Markup;
2626
using System.Windows.Media;
2727
using System.IO.Ports;
28+
using System.Windows;
2829

2930
//Sega Genesis VGM player. Player written and emulators ported by Landon Podbielski.
3031
namespace zanac.VGMPlayer
@@ -3457,6 +3458,11 @@ protected override void StreamSong()
34573458
if (adrs > 0xb2)
34583459
break;
34593460

3461+
#if DEBUG
3462+
if (adrs >= 0x10 && adrs <= 0x1c)
3463+
Console.WriteLine("YM2610: ADPCM B write " + (adrs).ToString("x") + "=" + (dt).ToString("x"));
3464+
#endif
3465+
34603466
if (comPortOPNB != null)
34613467
{
34623468
switch (adrs)
@@ -4254,6 +4260,11 @@ protected override void StreamSong()
42544260
for (uint i = 0; i < romData.Length; i++)
42554261
opnbPcm.adpcm_a_engine.intf().ymfm_external_write(access_class.ACCESS_ADPCM_A, saddr + i, romData[i]);
42564262
}
4263+
#if DEBUG
4264+
Console.WriteLine("YM2610: Transferred ADPCM A(" +
4265+
(saddr).ToString("x") + " - " + ((saddr + size - 1)).ToString("x") +
4266+
" (" + size.ToString("x") + ")");
4267+
#endif
42574268
}
42584269
}
42594270
break;
@@ -4276,6 +4287,11 @@ protected override void StreamSong()
42764287
for (uint i = 0; i < romData.Length; i++)
42774288
opnbPcm.adpcm_b_engine.intf().ymfm_external_write(access_class.ACCESS_ADPCM_B, saddr + i, romData[i]);
42784289
}
4290+
#if DEBUG
4291+
Console.WriteLine("YM2610: Transferred ADPCM B(" +
4292+
(saddr).ToString("x") + " - " + ((saddr + size - 1)).ToString("x") +
4293+
" (" + size.ToString("x") + ")");
4294+
#endif
42794295
}
42804296
}
42814297
break;

src/mamidimemo/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static class Program
4141
/// <summary>
4242
///
4343
/// </summary>
44-
public const string FILE_VERSION = "6.2.0.0";
44+
public const string FILE_VERSION = "6.2.1.0";
4545

4646
public const string FILE_COPYRIGHT = @"Virtual chiptune sound MIDI module ""MAmidiMEmo"" Version {0}
4747
Copyright(C) 2019, 2025 Itoken.All rights reserved.";

src/mamidimemo/VSIF/PortWriterMsxPi.cs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -275,26 +275,13 @@ private void sendData(byte[] sendData)
275275
{
276276
lock (LockObject)
277277
{
278-
if (!SerialPort.IsOpen)
279-
return;
280-
281278
try
282279
{
283-
int chunkSize = 8;
284-
int offset = 0;
285-
while (offset < sendData.Length)
286-
{
287-
if (!SerialPort.IsOpen)
288-
break;
289-
int size = Math.Min(chunkSize, sendData.Length - offset);
290-
byte[] chunk = new byte[size];
291-
Array.Copy(sendData, offset, chunk, 0, size);
292-
SerialPort?.Write(chunk, 0, size);
293-
offset += size;
294-
}
280+
SerialPort?.Write(sendData, 0, sendData.Length);
295281
}
296282
catch (Exception ex)
297283
{
284+
SerialPort.Close();
298285
if (ex.GetType() == typeof(Exception))
299286
throw;
300287
else if (ex.GetType() == typeof(SystemException))

0 commit comments

Comments
 (0)