diff --git a/CHANGE.txt b/CHANGE.txt index d134112..e710cdc 100644 --- a/CHANGE.txt +++ b/CHANGE.txt @@ -1,4 +1,7 @@ 更新履歴 +TAG053 2020/11/13 + Compiler/Driver:トレースモード、K/Rパート対応 + TAG052 2020/11/09 2nd Compiler:IDEスイッチをいれると圧縮処理をしないようにしてみた... diff --git a/PMDDotNETCompiler/mc.cs b/PMDDotNETCompiler/mc.cs index 53b0ba7..5870e83 100644 --- a/PMDDotNETCompiler/mc.cs +++ b/PMDDotNETCompiler/mc.cs @@ -5891,8 +5891,8 @@ private enmPass2JumpTable otoset() cx = (byte)cx * 0x100 + ((cx & 0xff00) >> 8); - m_seg.m_buf.Set(work.di + 0, new MmlDatum((byte)cx)); - m_seg.m_buf.Set(work.di + 1, new MmlDatum((byte)(cx >> 8))); + m_seg.m_buf.Set(work.di + 0, new MmlDatum((byte)cx)); //KUMA: @n + m_seg.m_buf.Set(work.di + 1, new MmlDatum((byte)(cx >> 8))); //KUMA: c work.di += 2; mml_seg.length_check1 = 1;//髻ウ髟キ繝繝シ繧ソ縺後≠縺」縺溘h @@ -7463,7 +7463,8 @@ private enmPass2JumpTable vseta() private enmPass2JumpTable vset() { - work.dx = (work.dx & 0xff00) + (byte)work.bx; + //work.dx = (work.dx & 0xff00) + (byte)work.bx; + work.dx = (byte)work.bx; return vset2(); } diff --git a/PMDDotNETConsole/Properties/launchSettings.json b/PMDDotNETConsole/Properties/launchSettings.json index e6da3c2..262c3df 100644 --- a/PMDDotNETConsole/Properties/launchSettings.json +++ b/PMDDotNETConsole/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "PMDDotNETConsole": { "commandName": "Project", - "commandLineArgs": "-LOGLEVEL=DEBUG /V /c D:\\bootcamp\\FM髻ウ貅申\player\\pmd\\fromTAN-Y\\ORANGE04.MML" + "commandLineArgs": "-LOGLEVEL=DEBUG /V /c D:\\bootcamp\\FM髻ウ貅申\player\\pmd\\fromTAN-Y\\testSSS_EXER.MML" } } } \ No newline at end of file diff --git a/PMDDotNETDriver/EFCDRV.cs b/PMDDotNETDriver/EFCDRV.cs index 1b25851..4e888d5 100644 --- a/PMDDotNETDriver/EFCDRV.cs +++ b/PMDDotNETDriver/EFCDRV.cs @@ -101,7 +101,19 @@ private void eff_main() r.bl ^= 0b0000_1111;//volume r.ah = 1;//command r.al &= 0x7f;//num? - ChipDatum cd = new ChipDatum(0x01, (r.al << 8) | r.bh, r.bl); + + ChipDatum cd = new ChipDatum(-1, -1, -1); + cd.addtionalData = pw.cmd; + pmd.WriteOPNARegister(cd); + if (pw.cmd != null && pw.cmd.args != null && pw.cmd.args.Count > 2 && pw.cmd.args[2] is MmlDatum[]) + { + foreach (MmlDatum md in (MmlDatum[])pw.cmd.args[2]) + { + pmd.ExecIDESpecialCommand(md); + } + } + + cd = new ChipDatum(0x01, (r.al << 8) | r.bh, r.bl); ppsdrv(cd);//.Play(r.al, r.bh, r.bl);//; ppsdrv keyon ppsdrm_ret:; return; @@ -125,6 +137,20 @@ private void eff_main() cd = new ChipDatum(0x02, 0, 0); ppsdrv(cd);//.Stop();//; ppsdrv 蠑キ蛻カkeyoff eok_nonppsdrv:; + + + cd = new ChipDatum(-1, -1, -1); + cd.addtionalData = pw.cmd; + pmd.WriteOPNARegister(cd); + if (pw.cmd != null && pw.cmd.args != null && pw.cmd.args.Count > 2 && pw.cmd.args[2] is MmlDatum[]) + { + foreach (MmlDatum md in (MmlDatum[])pw.cmd.args[2]) + { + pmd.ExecIDESpecialCommand(md); + } + } + + r.si = 0;// pw.efftbl[r.bx].Item2; r.si += 0;//offset efftbl pw.crtEfcDat = pw.efftbl[r.bx].Item2; diff --git a/PMDDotNETDriver/PMD.cs b/PMDDotNETDriver/PMD.cs index 38e7e64..516e5b0 100644 --- a/PMDDotNETDriver/PMD.cs +++ b/PMDDotNETDriver/PMD.cs @@ -2013,6 +2013,9 @@ private void rhyms00() rlnset(); } + /// + /// 髻ウ髟キ繧定ェュ縺ソ蜿悶j縲√そ繝繝 + /// private void rlnset() { r.al = (byte)pw.rd[r.bx].dat;// mov al,[bx] @@ -2041,6 +2044,7 @@ private void rlnset() private void reom() { + //KUMA: K part 縺ョ隗」譫 reom:; do { @@ -2048,12 +2052,12 @@ private void reom() r.al = (byte)pw.md[r.si].dat; if (r.si == pw.jumpIndex) - pw.jumpIndex = -1;//KUMA:Added + pw.jumpIndex = -1;//KUMA:Added 繧ケ繧ュ繝繝怜咲函蜷代¢ r.si++; if (r.al == 0x80) goto rfin; - if (r.al < 0x80) break; + if (r.al < 0x80) break; // K part 縺ォ Rn 繧ウ繝槭Φ繝峨′謖螳壹&繧後※縺縺溷エ蜷 object o = commandsr(); while (o != null) @@ -2062,48 +2066,67 @@ private void reom() } } while (true); + //KUMA: R part 縺ォ蜃ヲ逅繧貞繧頑崛縺医k貅門y + + //Console.WriteLine("{0}", pw.cmd); + FlashMacroList(); + MmlDatum md = new MmlDatum(enmMMLType.TraceLocate, null, LinePos.Copy(pw.cmd.linePos), 0xff); + md = new MmlDatum(enmMMLType.TraceLocate, new List(new object[] { 0, 1, md }), LinePos.Copy(pw.cmd.linePos), 0xff); + ChipDatum cd = new ChipDatum(-1, -1, -1); + cd.addtionalData = md; + WriteDummy(cd); + //re00: pw.partWk[r.di].address = r.si; r.ah = 0; r.ax += r.ax; - r.ax += (ushort)pw.radtbl; + r.ax += (ushort)pw.radtbl;//KUMA: R part縲縺ョ繧「繝峨Ξ繧ケ繝繝シ繝悶Ν0x00ス樊怙螟ァ0x7f蛻蟄伜惠縺励≧繧 r.bx = r.ax; r.ax = (ushort)(pw.md[r.bx].dat + pw.md[r.bx + 1].dat * 0x100);// mov ax,[bx] r.ax += (ushort)pw.mmlbuf; pw.rhyadr = r.ax; + + //KUMA: R part 縺ォ蜃ヲ逅繧貞繧頑崛縺 + r.bx = r.ax; pw.rd = pw.md; - rhyms00:; - { - pw.cmd = pw.rd[r.bx];// mov al,[bx] - r.al = (byte)pw.rd[r.bx].dat;// mov al,[bx] - r.bx++; - - if (r.al == 0xff) - { - goto reom; - } - if ((r.al & 0x80) != 0) - { - int r = rhythmon(); - if (r == 1) goto rhyms00; - return; - } + rhyms00:; + pw.cmd = pw.rd[r.bx];// mov al,[bx] + r.al = (byte)pw.rd[r.bx].dat;// mov al,[bx] + r.bx++; - FlashMacroList(); + if (r.al == 0xff) //KUMA: R part 邨らォッ縺ョ蝣エ蜷医ッ K part 隗」譫舌↓謌サ繧 + { + goto reom; + } - pw.kshot_dat = 0;//; rest - rlnset(); + //0x00 - 0x7f : 莨醍ャヲ + //0x80 - 0xbf : 髻ウ隨ヲ(逋コ髻ウ) + //0xc0 - 0xff : 繧ウ繝槭Φ繝 + if ((r.al & 0x80) != 0) //KUMA: 譛荳贋ス甲it縺1縺九←縺縺九メ繧ァ繝繧ッ(mml繧ウ繝槭Φ繝/逋コ髻ウ縺九←縺縺九メ繧ァ繝繧ッ) + { + int r = rhythmon(); + if (r == 1) goto rhyms00;//KUMA: 1縺ョ(騾」邯壹〒繧ウ繝槭Φ繝峨r螳溯。後@縺溘>)蝣エ蜷医ッ繝ォ繝シ繝 return; } + //KUMA: al縺0ス0x7f縺ョ蝣エ蜷医ッ莨醍ャヲ蜃ヲ逅 + + FlashMacroList(); + + pw.kshot_dat = 0;//; rest + rlnset(); + return; + rfin:; + //KUMA: K part邨らォッ蜃ヲ逅 + FlashMacroList(); r.si--; @@ -2135,19 +2158,24 @@ private void reom() //;============================================================================== private int rhythmon() { - if ((r.al & 0b0100_0000) == 0) + if ((r.al & 0b0100_0000) == 0)//KUMA: bit6縺0縺ョ蝣エ蜷医ッ繝ェ繧コ繝髻ウ縺ョ逋コ髻ウ蜃ヲ逅縺ク goto rhy_shot; + + //KUMA: 蜷繧ウ繝槭Φ繝牙ヲ逅縺ッr.si繧偵う繝ウ繝繝繧ッ繧ケ縺ィ縺励※菴ソ縺縺ョ縺ァbx縺ィsi繧貞・繧梧崛縺医k + ushort a = r.si; r.si = r.bx; r.bx = a; r.stack.Push(r.bx); - object o = commandsr(); + object o = commandsr(); //KUMA: al縺檎、コ縺吶√さ繝槭Φ繝牙ヲ逅繧偵b繧峨▲縺ヲ縺上k while (o != null) { - o = ((Func)o)(); + o = ((Func)o)();//KUMA: 繧ウ繝槭Φ繝牙ョ滓命 } + //KUMA: 蜈縺ォ謌サ縺 + r.bx = r.stack.Pop(); a = r.si; r.si = r.bx; @@ -2164,7 +2192,8 @@ private int rhythmon() return 0; r_nonmask:; r.ah = r.al; - r.al = (byte)pw.rd[r.bx].dat; + pw.cmd = pw.rd[r.bx]; + r.al = (byte)pw.rd[r.bx].dat;//譛ャ譚・縺ョ髻ウ隨ヲ繧ウ繝槭Φ繝 r.bx++; r.ax &= 0x3fff; pw.kshot_dat = r.ax; @@ -10614,7 +10643,7 @@ public void WriteDummy(ChipDatum cd) } } - private void ExecIDESpecialCommand(MmlDatum md) + public void ExecIDESpecialCommand(MmlDatum md) { //Console.WriteLine("{0}", md); diff --git a/PMDDotNETPlayer/PMDDotNETPlayer.csproj.user b/PMDDotNETPlayer/PMDDotNETPlayer.csproj.user index 2ecabc6..83a1242 100644 --- a/PMDDotNETPlayer/PMDDotNETPlayer.csproj.user +++ b/PMDDotNETPlayer/PMDDotNETPlayer.csproj.user @@ -1,7 +1,7 @@ サソ - -D=EMU -L=2 "D:\bootcamp\FM髻ウ貅申player\pmd\AIR_T06.MZ" + -D=EMU -L=2 "D:\bootcamp\FM髻ウ貅申player\pmd\fromTAN-Y\testSSS_EXER.M" -D=GIMIC C:\Users\kuma\Desktop\desire\des_26.m