Skip to content

Commit

Permalink
TAG174 2022/05/20
Browse files Browse the repository at this point in the history
  Driver
    初回のタイマー割り込みを予め行っておくよう修正
  • Loading branch information
kumatan committed May 19, 2022
1 parent 4d08ab4 commit eb39881
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
�X�V����
TAG174 2022/05/20
Driver
����̃^�C�}�[���荞�݂�\�ߍs���Ă����悤�C��

TAG173 2022/05/19
Driver
AllMute�̏����̕s����C��
Expand Down
2 changes: 1 addition & 1 deletion mucomDotNETConsole/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"Console": {
"commandName": "Project",
"commandLineArgs": "-LOGLEVEL=TRACE \"D:\\bootcamp\\FM音源\\data\\MUC\\test\\test.muc\""
"commandLineArgs": "-LOGLEVEL=TRACE \"D:\\bootcamp\\FM音源\\data\\自作\\test\\test.muc\""
}
}
}
57 changes: 42 additions & 15 deletions mucomDotNETDriver/music2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,31 @@ public void MSTART(int musicNumber)
CHK();//added
INT57();
ENBL();

for (int c = 0; c < 5; c++)
{
work.soundWork.currentChip = c;
work.currentTimer = c;
TO_NML();
}
work.soundWork.currentChip = 0;

work.resetPlaySync = true;
work.Status = 1;
work.currentTimer = 0;

//一度だけタイマ割り込みをさせる(初めの発音が不安定になる現象対策)
while ((work.timerOPNA1.StatReg & 3) == 0)
{
lock (work.SystemInterrupt)
{
work.timerOPNA1.timer();
work.timerOPNA2.timer();
work.timerOPNB1.timer();
work.timerOPNB2.timer();
work.timerOPM.timer();
}
}
}
}

Expand Down Expand Up @@ -838,21 +854,13 @@ private void STTMB(byte e)

public void PL_SND()
{
ChipDatum dat;
if (work.currentTimer != 4)
{
dat = new ChipDatum(0, 0x27, work.soundWork.PLSET1_VAL[work.currentTimer]);// TIMER-OFF DATA
WriteRegister(work.currentTimer, dat);
dat = new ChipDatum(0, 0x27, work.soundWork.PLSET2_VAL[work.currentTimer]);// TIMER-ON DATA
WriteRegister(work.currentTimer, dat);
}
else
{
dat = new ChipDatum(0, 0x14, work.soundWork.PLSET1_VAL[work.currentTimer]);// TIMER-OFF DATA
WriteRegister(work.currentTimer, dat);
dat = new ChipDatum(0, 0x14, work.soundWork.PLSET2_VAL[work.currentTimer]);// TIMER-ON DATA
WriteRegister(work.currentTimer, dat);
}
updateTimer();

//if (work.dummyCount > 0)
//{
// work.dummyCount--;
// return;
//}

DRIVE();
//FDOUT();
Expand All @@ -876,6 +884,25 @@ public void PL_SND()
work.Status = 0;
}

private void updateTimer()
{
ChipDatum dat;
if (work.currentTimer != 4)
{
dat = new ChipDatum(0, 0x27, work.soundWork.PLSET1_VAL[work.currentTimer]);// TIMER-OFF DATA
WriteRegister(work.currentTimer, dat);
dat = new ChipDatum(0, 0x27, work.soundWork.PLSET2_VAL[work.currentTimer]);// TIMER-ON DATA
WriteRegister(work.currentTimer, dat);
}
else
{
dat = new ChipDatum(0, 0x14, work.soundWork.PLSET1_VAL[work.currentTimer]);// TIMER-OFF DATA
WriteRegister(work.currentTimer, dat);
dat = new ChipDatum(0, 0x14, work.soundWork.PLSET2_VAL[work.currentTimer]);// TIMER-ON DATA
WriteRegister(work.currentTimer, dat);
}
}

// ** CALL FM **

private Tuple<string, int, int, int, int, Action>[] aryDRIVE;
Expand Down
2 changes: 1 addition & 1 deletion mucomDotNETPlayer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ private static void OPMWrite(int chipId, ChipDatum dat)

if (dat.address == -1) return;

Log.WriteLine(LogLevel.TRACE, string.Format("Out ChipOPM:{0} Port:{1} Adr:[{2:x02}] val[{3:x02}]", chipId, dat.port, (int)dat.address, (int)dat.data));
//Log.WriteLine(LogLevel.TRACE, string.Format("Out ChipOPM:{0} Port:{1} Adr:[{2:x02}] val[{3:x02}]", chipId, dat.port, (int)dat.address, (int)dat.data));
switch (device)
{
case 0:
Expand Down
2 changes: 1 addition & 1 deletion mucomDotNETPlayer/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"Player": {
"commandName": "Project",
"commandLineArgs": "\"D:\\bootcamp\\FM音源\\data\\MUC\\test\\test.mub\""
"commandLineArgs": "\"D:\\bootcamp\\FM音源\\data\\自作\\test\\test.mub\""
}
}
}

0 comments on commit eb39881

Please sign in to comment.