Skip to content

Commit

Permalink
TAG007 2020/05/03
Browse files Browse the repository at this point in the history
  Compiler
    ・リズムパートでエイリアスを使用したとき元のデータに戻れなくなるバグを修正
    ・0x2000より小さいFFファイルを読み込んだ時、音色定義ができないことがあるバグを修正
    ・TITLEタグの後にTIMERタグがあるとTITLEタグを破壊してしまうバグを修正
    ・値取得処理にて16bitの値が取得できていなかったのを修正
  • Loading branch information
kumatan committed May 2, 2020
1 parent 23c8490 commit 6a146b3
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 34 deletions.
7 changes: 7 additions & 0 deletions CHANGE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
�X�V����
TAG007 2020/05/03
Compiler
�E���Y���p�[�g�ŃG�C���A�X���g�p�����Ƃ����̃f�[�^�ɖ߂�Ȃ��Ȃ�o�O���C��
�E0x2000��菬����FF�t�@�C����ǂݍ��񂾎��A���F��`���ł��Ȃ����Ƃ�����o�O���C��
�ETITLE�^�O�̌��TIMER�^�O�������TITLE�^�O��j�󂵂Ă��܂��o�O���C��
�E�l�擾�����ɂ�16bit�̒l���擾�ł��Ă��Ȃ������̂��C��

TAG006 2020/05/02 5th
Compiler
�EQ�R�}���h�Al�R�}���h�Ainclude�^�O�̃o�O���C��
Expand Down
16 changes: 8 additions & 8 deletions PMDDotNETCompiler/lc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ public void lc_proc(byte al)
enmPart_ends ret;
ret = enmPart_ends.calc_start;

//List<byte> dst = new List<byte>();
//dst.Add(0);
//for (int i = 0; i < m_seg.m_buf.Count; i++)
//{
// MmlDatum o = m_seg.m_buf.Get(i);
// dst.Add((byte)(o == null ? 0xff : o.dat));
//}
//System.IO.File.WriteAllBytes("c:\\temp\\debug",dst.ToArray());
List<byte> dst = new List<byte>();
dst.Add(0);
for (int i = 0; i < m_seg.m_buf.Count; i++)
{
MmlDatum o = m_seg.m_buf.Get(i);
dst.Add((byte)(o == null ? 0xff : o.dat));
}
System.IO.File.WriteAllBytes("c:\\temp\\debug", dst.ToArray());

do
{
Expand Down
54 changes: 34 additions & 20 deletions PMDDotNETCompiler/mc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class mc
private mml_seg mml_seg = null;
private fnumdat_seg fnumdat_seg = null;
private hs_seg hs_seg = null;

private voice_seg voice_seg = null;

//;==============================================================================
//;
Expand Down Expand Up @@ -156,17 +156,26 @@ public mc(Compiler compiler, string[] args, string srcBuf, byte[] ffBuf, work wo
this.work = work;
this.kankyo_seg = kankyo_seg;

voice_seg = new voice_seg();
m_seg = new m_seg();
lc = new lc(this, work, m_seg);
mml_seg = new mml_seg();
mml_seg.mml_buf = srcBuf;
voice_seg.voice_buf = ffBuf;
voiceTrancer(ffBuf);
setupComTbl();
setupRcomtbl();
fnumdat_seg = new fnumdat_seg();
hs_seg = new hs_seg();
}

private void voiceTrancer(byte[] ffBuf)
{
voice_seg.voice_buf = new byte[8192];
if (ffBuf == null || ffBuf.Length < 1) return;
for(int i=0;i< ffBuf.Length;i++)
voice_seg.voice_buf[i] = ffBuf[i];
}

//;==============================================================================
//; compile start
//;==============================================================================
Expand Down Expand Up @@ -1366,8 +1375,15 @@ private enmPass2JumpTable rtlp2()
if (ret == enmPass2JumpTable.exit) break;
if (ret == enmPass2JumpTable.hscom_exit)
{
mml_seg.hsflag--;
break;
if (mml_seg.hsflag > 1)
{
ret = hscom_exit();
}
else
{
mml_seg.hsflag--;
break;
}
}

} while (ret != enmPass2JumpTable.forceReturn);
Expand Down Expand Up @@ -1841,16 +1857,14 @@ private void read_fffile()
try
{
voice_seg.voice_buf = compiler.ReadFile(voice_seg.v_filename);
if (voice_seg.voice_buf == null)
print_mes(mml_seg.warning_mes + mml_seg.ff_readerr_mes);
voiceTrancer(voice_seg.voice_buf);
}
catch
{
}

if (voice_seg.voice_buf == null)
{
voice_seg.voice_buf = new byte[8192];
print_mes(mml_seg.warning_mes + mml_seg.ff_readerr_mes);
}

#if !hyouka
mml_seg.prg_flg |= 1;
Expand Down Expand Up @@ -2322,6 +2336,7 @@ private void title_set(string ah, int bx)
if (al == "M")//#TIMer
{
tempo_set2();
return;
}

mml_seg.title_adr = work.si;
Expand Down Expand Up @@ -5926,12 +5941,12 @@ private bool lngset2(out int bx, out byte al)
private bool hexget8(out byte al_b)
{
al_b = (byte)mml_seg.mml_buf[work.si++];
if (hexcal8(ref al_b)) return true;//;ERROR RETURN
if (!hexcal8(ref al_b)) return true;//;ERROR RETURN

byte bl = al_b;
al_b = (byte)mml_seg.mml_buf[work.si++];

if (!hexcal8(ref al_b))
if (hexcal8(ref al_b))
{
al_b += (byte)(bl * 16);
return false;
Expand All @@ -5944,17 +5959,14 @@ private bool hexget8(out byte al_b)

private bool hexcal8(ref byte al_b)
{
try
if (byte.TryParse(((char)al_b).ToString(), System.Globalization.NumberStyles.HexNumber, null, out al_b))
{
int a = Convert.ToInt32(((char)al_b).ToString(), 16);
al_b = (byte)a;
return true;
}
catch
else
{
return true;
return false;
}

return false;
}


Expand Down Expand Up @@ -6656,7 +6668,7 @@ private enmPass2JumpTable vss()

cy = getnum(out bx, out dl);

mml_seg.volss = dl;
mml_seg.volss = (sbyte)dl;
work.dx = (work.dx & 0xff00) | (byte)mml_seg.nowvol;
#if !efc
if (mml_seg.part == mml_seg.pcmpart) return enmPass2JumpTable.vsetm1;
Expand Down Expand Up @@ -6756,7 +6768,7 @@ private enmPass2JumpTable neirochg()
}

work.bx |= (0b1000_0000) * 0x100;
mml_seg.lastprg = bx;
mml_seg.lastprg = work.bx;
return enmPass2JumpTable.olc03;

psgprg:;
Expand Down Expand Up @@ -7135,6 +7147,7 @@ private bool getnum(out int bx, out byte dl)
if (dh == 0)
{
work.dx = dl;
work.bx = bx;
return cy;
}

Expand All @@ -7143,6 +7156,7 @@ private bool getnum(out int bx, out byte dl)
dl = (byte)(-(int)dl);

work.dx = (dh << 8) | dl;
work.bx = bx;
return cy;
}

Expand Down
7 changes: 3 additions & 4 deletions PMDDotNETCompiler/voice_seg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

namespace PMDDotNET.Compiler
{
public static class voice_seg
public class voice_seg
{
public static string v_filename;//b 128 dup(?)
public static byte[] voice_buf = new byte[8192];

public string v_filename;//b 128 dup(?)
public byte[] voice_buf = new byte[8192];
}
}
2 changes: 1 addition & 1 deletion PMDDotNETConsole/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"PMDDotNETConsole": {
"commandName": "Project",
"commandLineArgs": "/v C:\\Users\\kuma\\Desktop\\pmd\\てすと.mml"
"commandLineArgs": "/v C:\\Users\\kuma\\Desktop\\pmd\\LIM9808A.mml"
}
}
}
Binary file modified PMDDotNETDriver/bin/Debug/netstandard2.0/PMDDotNETDriver.dll
Binary file not shown.
Binary file modified PMDDotNETDriver/bin/Debug/netstandard2.0/PMDDotNETDriver.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
906558722fc4b8963e1b9685514d685213bf38a1
ef89a941385d3a0ab06ffdd2514daa37d6325ae5
Binary file not shown.
Binary file modified PMDDotNETDriver/obj/Debug/netstandard2.0/PMDDotNETDriver.dll
Binary file not shown.
Binary file modified PMDDotNETDriver/obj/Debug/netstandard2.0/PMDDotNETDriver.pdb
Binary file not shown.
Binary file modified PMDDotNETPlayer/bin/Debug/PMDDotNETDriver.dll
Binary file not shown.
Binary file modified PMDDotNETPlayer/bin/Debug/PMDDotNETDriver.pdb
Binary file not shown.
Binary file not shown.

0 comments on commit 6a146b3

Please sign in to comment.