Skip to content

Commit

Permalink
TAG744 2024/10/03
Browse files Browse the repository at this point in the history
  POKEY:ポルタメント、ノイズ出力に対応
  • Loading branch information
kumatan committed Oct 2, 2024
1 parent a1ec313 commit 41e816c
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 175 deletions.
3 changes: 3 additions & 0 deletions mml2vgm/CHANGE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
�X�V����
TAG744 2024/10/03
POKEY:�|���^�����g�A�m�C�Y�o�͂ɑΉ�

TAG743 2024/10/01
Core:POKEY�Ɏb��Ή�_2nd

Expand Down
37 changes: 34 additions & 3 deletions mml2vgm/Core/chips/Pokey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public class Pokey : ClsChip
private const byte AUDF4 = 0x06;
private const byte AUDC4 = 0x07;

public byte AUDCTLvalue = 0x00;
public byte AUDCTLvalueBefore = 0xff;

public Pokey(ClsVgm parent, int chipID, string initialPartName, string stPath, int chipNumber) : base(parent, chipID, initialPartName, stPath, chipNumber)
{
_chipType = enmChipType.POKEY;
Expand Down Expand Up @@ -104,6 +107,8 @@ public override void InitPart(partWork pw)
pg.noise = 7;
}

AUDCTLvalue = 0x00;
AUDCTLvalueBefore = 0xff;
}

public override void InitChip()
Expand Down Expand Up @@ -226,6 +231,28 @@ private void SetSsgVolume(partPage page, MML mml)
{
}

public override void SetToneDoubler(partPage page, MML mml)
{
}

public override int GetToneDoublerShift(partPage page, int octave, char noteCmd, int shift)
{
return 0;
}

public override int GetFNum(partPage page, MML mml, int octave, char cmd, int shift, int pitchShift)
{
return GetSsgFNum(page, mml, octave, cmd, shift, pitchShift);
}

public override void CmdNoise(partPage page, MML mml)
{
int n = (int)mml.args[0];
n = Common.CheckRange(n, 0, 7);
page.noise = 7 - n;
}



public override void MultiChannelCommand(MML mml)
{
Expand Down Expand Up @@ -258,9 +285,13 @@ public override void MultiChannelCommand(MML mml)
}


//Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
//17 vs 9 Poly CH1 1.79 CH3 1.79 CH2 + 1 CH4 + 3 FI1 + 3 FI2 + 4 64 vs 15 kHz
parent.OutData(mml, port[0], AUDCTL, 0x00);
if (AUDCTLvalue != AUDCTLvalueBefore)
{
//Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
//17 vs 9 Poly CH1 1.79 CH3 1.79 CH2 + 1 CH4 + 3 FI1 + 3 FI2 + 4 64 vs 15 kHz
parent.OutData(mml, port[0], AUDCTL, AUDCTLvalue);
AUDCTLvalueBefore = AUDCTLvalue;
}
}

}
Expand Down
28 changes: 20 additions & 8 deletions mml2vgm/mml2vgm/sample/POKEY/testPOKEY.gwi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'{

TitleName =
TitleName = POKEY TEST
TitleNameJ =
GameName =
GameNameJ =
Expand All @@ -18,11 +18,23 @@
'Cn1 T120
Cn1 L

'Pa1-4 v10o4q0l4
'Pa1 c1 r4 c2
'Pa2 re2. r4 e2
'Pa3 rrg2 r4 g2
'Pa4 rrr>c4 r4 c2


トーンテスト
'Pa1-4 v10o4q0l4w0
'Pa1 c1 r c2 r
'Pa2 re2. r e2 r
'Pa3 rrg2 r g2 r
'Pa4 rrr>c4 r c2 r


ノイズテスト
'Pa1-4 v10q0l4

'Pa1 w1 o7c_<<<c rrr ; 4bit poly only
'Pa2 r w2 o7c_<<<c rr ; pure tone
'Pa3 rr w3 o7c_<<<c r ; 17bit poly only
'Pa4 rrr w4 o7c_<<<c ; 5bit poly only
'Pa1 w5 o7c_<<<c rrr ; 5bit then 4bit polys
'Pa2 r w6 o7c_<<<c rr ; 5bit poly only
'Pa3 rr w7 o7c_<<<c r ; 5bit then 17bit polynomials
'Pa4 rrr w0 o7c_<<<c ; pure tone (default)

34 changes: 0 additions & 34 deletions mml2vgm/mml2vgm/sample/POKEY/testPOKEY_638626989728130255.bak.gwi

This file was deleted.

34 changes: 0 additions & 34 deletions mml2vgm/mml2vgm/sample/POKEY/testPOKEY_638626991660841241.bak.gwi

This file was deleted.

34 changes: 0 additions & 34 deletions mml2vgm/mml2vgm/sample/POKEY/testPOKEY_638626993249148291.bak.gwi

This file was deleted.

34 changes: 0 additions & 34 deletions mml2vgm/mml2vgm/sample/POKEY/testPOKEY_638627000946081134.bak.gwi

This file was deleted.

28 changes: 0 additions & 28 deletions mml2vgm/mml2vgm/sample/POKEY/testPOKEY_638633619595236183.bak.gwi

This file was deleted.

0 comments on commit 41e816c

Please sign in to comment.