Skip to content

Commit 0519560

Browse files
committed
- 6.0.2.2 Fixed PAULA_8364(AMIGA) annoying noize issue.
1 parent 42e3dcd commit 0519560

File tree

7 files changed

+27
-26
lines changed

7 files changed

+27
-26
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MAmidiMEmo 6.0.2.1 Itoken (c)2019, 2025 / GPL-2.0
1+
MAmidiMEmo 6.0.2.2 Itoken (c)2019, 2025 / GPL-2.0
22

33
*** What is the MAmidiMEmo? ***
44

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

276276
*** Changes
277+
- 6.0.2.2 Fixed PAULA_8364(AMIGA) annoying noize issue.
277278
- 6.0.2.1 Fixed PAULA_8364(AMIGA) freezing issue.
278279
- 6.0.2.0 Improved UART transmission of PAULA_8364(AMIGA).
279280
- 6.0.1.0 Supported importing *.sf file to PAULA_8364(AMIGA).

src/VSIF/VSIF_AMIGA/audio.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void aud_memcpy(volatile struct AudChannel *dest, volatile struct AudChannel *sr
1818
}
1919

2020

21-
void reqPlayPcm(int ch, int id, UWORD volume, UWORD period)
21+
void reqPlayPcm(UBYTE ch, UBYTE id, UWORD volume, UWORD period)
2222
{
2323
if(pcmDataTable[id].dataPtr == 0)
2424
return;
@@ -73,13 +73,15 @@ void reqPlayPcm(int ch, int id, UWORD volume, UWORD period)
7373

7474
/*
7575
*/
76-
void reqStopPcm(int ch)
76+
void reqStopPcm(UBYTE ch)
7777
{
7878
// custom->intena = (INTF_AUD0 << ch);
7979
// custom->intreq = (INTF_AUD0 << ch); custom->intreq = (INTF_AUD0 << ch);
8080

81+
custom->dmacon = (DMAF_AUD0 << ch); // Stop DMA for AUD
82+
8183
ULONG *audl = (ULONG *)&custom->aud[ch];
82-
*audl++ = (ULONG)0;
84+
*audl++ = (ULONG)StopData;
8385
UWORD *aud = (UWORD *)audl;
8486
*aud++ = 0;
8587
*aud++ = 1;

src/VSIF/VSIF_AMIGA/main.c

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -378,28 +378,30 @@ VWritef("Completed serial setting.\n", NULL);
378378
case 1: // Volume
379379
{
380380
requestSerial(5);
381-
381+
382382
UWORD vol = *dataBufPtr;
383383
#ifndef NO_LOOP
384384
curPlayData[ch].aud.ac_vol = vol;
385385
#endif
386386
custom->aud[ch].ac_vol = vol;
387387
#ifdef LOG
388-
VWritef("Vol\n", NULL);
388+
ULONG arg[] = {vol};
389+
VWritef("Vol %N\n", arg);
389390
#endif
390391
}
391392
break;
392393
case 2: // Pitch
393394
{
394395
requestSerial(5);
395396

396-
UWORD per = ((UWORD)*dataBufPtr++ << 8) + *dataBufPtr;
397+
UWORD per = *(UWORD *)dataBufPtr;
397398
#ifndef NO_LOOP
398399
curPlayData[ch].aud.ac_per = per;
399400
#endif
400401
custom->aud[ch].ac_per = per;
401402
#ifdef LOG
402-
VWritef("Pitch\n", NULL);
403+
ULONG arg[] = {per};
404+
VWritef("Pitch %N\n", arg);
403405
#endif
404406
}
405407
break;
@@ -412,7 +414,7 @@ VWritef("Completed serial setting.\n", NULL);
412414
// vol 0 - 64;
413415
UWORD vol = *dataBufPtr++;
414416
// period 0 - 65535
415-
UWORD per = ((UWORD)*dataBufPtr++ << 8) + *dataBufPtr;
417+
UWORD per = *(UWORD *)dataBufPtr;
416418

417419
reqPlayPcm(ch, id, vol, per);
418420
#ifdef LOG
@@ -437,13 +439,10 @@ VWritef("Completed serial setting.\n", NULL);
437439
requestSerial(5);
438440

439441
if(*dataBufPtr == 0)
440-
{
442+
{
441443
//Filter off
442444
__asm volatile (
443-
"BSET.B #1,0xbfe001\n"
444-
:
445-
:
446-
:
445+
"BSET.B #1,0xbfe001\n":::
447446
"cc", "memory");
448447
#ifdef LOG
449448
VWritef("Flt OFF\n", NULL);
@@ -452,10 +451,7 @@ VWritef("Completed serial setting.\n", NULL);
452451
{
453452
//Filter on
454453
__asm volatile (
455-
"BCLR.B #1,0xbfe001\n"
456-
:
457-
:
458-
:
454+
"BCLR.B #1,0xbfe001\n":::
459455
"cc", "memory");
460456
#ifdef LOG
461457
VWritef("Flt ON\n", NULL);
@@ -470,8 +466,8 @@ VWritef("Completed serial setting.\n", NULL);
470466
#endif
471467

472468
UBYTE id = *dataBufPtr++;
473-
UWORD len = ((UWORD)*dataBufPtr++ << 8) + *dataBufPtr++;
474-
//UWORD loop = ((UWORD)*dataBufPtr++ << 8) + *dataBufPtr;
469+
UWORD len = *(UWORD *)dataBufPtr++;
470+
//UWORD loop = *(UWORD *)dataBufPtr++;
475471
//if(loop >= len)
476472
// loop = 0xFFFF;
477473
UWORD loop = 0;
@@ -532,7 +528,7 @@ VWritef("Completed serial setting.\n", NULL);
532528
requestSerial(5);
533529

534530
UBYTE id = *dataBufPtr++;
535-
UWORD loop = ((UWORD)*dataBufPtr++ << 8) + *dataBufPtr;
531+
UWORD loop = *(UWORD *)dataBufPtr;
536532
UWORD len = pcmDataTable[id].length;
537533
if(loop >= len)
538534
loop = 0xFFFF;

src/VSIF/VSIF_AMIGA/main.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ struct AudioMessage
110110
extern struct PcmData pcmDataTable[256];
111111
extern volatile struct PlayData curPlayData[4];
112112

113-
void reqPlayPcm(int ch, int id, UWORD volume, UWORD period);
114-
void reqStopPcm(int ch);
113+
void reqPlayPcm(UBYTE ch, UBYTE id, UWORD volume, UWORD period);
114+
void reqStopPcm(UBYTE ch);
115115
void audioTask(void);
116116

-20 Bytes
Binary file not shown.

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.0.2.1";
44+
public const string FILE_VERSION = "6.0.2.2";
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/instruments/Chips/PAULA_8364.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,8 @@ private void Paula8364Write(uint unitNumber, PAULA_CMD type, uint address, ushor
551551
{
552552
case SoundEngineType.VSIF_AMIGA:
553553
// ch, value
554-
vsifClient.RawWriteData(new byte[] { (byte)((byte)type | (ch << 4)), (byte)data, 0, 0, 0 }, null);
554+
vsifClient.RawWriteData(new byte[] { (byte)((byte)type | (ch << 4)),
555+
(byte)data, 0, 0, 0 }, null);
555556
break;
556557
}
557558
}
@@ -569,7 +570,8 @@ private void Paula8364Write(uint unitNumber, PAULA_CMD type, uint address, ushor
569570
{
570571
case SoundEngineType.VSIF_AMIGA:
571572
// ch, value
572-
vsifClient.RawWriteData(new byte[] { (byte)((byte)type | (ch << 4)), (byte)(data >> 8), (byte)data, 0, 0 }, null);
573+
vsifClient.RawWriteData(new byte[] { (byte)((byte)type | (ch << 4)),
574+
(byte)(data >> 8), (byte)data, 0, 0 }, null);
573575
break;
574576
}
575577
}

0 commit comments

Comments
 (0)