//139-181 //;============================================================================== //; PCM音源演奏メイン:パートマスクされている時 //;============================================================================== private Func <object> pcmmain_nonplay() { pw.partWk[r.di].keyoff_flag = 0xff;// -1 pw.partWk[r.di].leng--; if (pw.partWk[r.di].leng != 0) { return(pmd.mnp_ret); } if ((pw.partWk[r.di].partmask & 2) == 0)//; bit1(pcm効果音中?)をcheck { return(pcmmnp_1); } r.dx = (ushort)pw.fm2_port1; r.al = pc98.InPort(r.dx); if ((r.al & 0b0000_0100) == 0) //;EOS check { return(pcmmnp_1); //; まだ割り込みPCMが鳴っている } pw.pcmflag = 0; //; PCM効果音終了 pw.pcm_effec_num = 255; pw.partWk[r.di].partmask &= 0xfd; //;bit1をclear if (pw.partWk[r.di].partmask == 0) { return(mp1m0);//;partmaskが0なら復活させる } return(pcmmnp_1); }
public void debug_pcm(int adr) { #if DEBUG r.al = pc98.InPort(0xa468);//86音源FIFO if ((r.al & 0x10) != 0) { debug(adr); } #endif }
//978-1189 //;============================================================================== //; PCMメモリへメインメモリからデータを送る(x8, 高速/低速選択版) //; //; INPUTS..cs:[pcmstart] to Start Address //; .. cs:[pcmstop] to Stop Address //; .. cs:[pcmdata_ofs/seg] // to PCMData_Buffer //;============================================================================== private void pcmstore() { key_check_reset(); r.dx = 0x0001; out46(); r.dx = 0x1017;//;brdy以外はマスク(=timer割り込みは掛からない) out46(); r.dx = 0x1080; out46(); r.dx = 0x0060; out46(); r.dx = 0x0102;//;x8 out46(); r.dx = 0x0cff; out46(); r.dh++; out46(); r.bx = pw.pcmload_pcmstart; r.dh = 0x02; r.dl = r.bl; out46(); r.dh++; r.dl = r.bh; out46(); r.dx = 0x04ff; out46(); r.dh++; out46(); r.si = 0;//[pcmdata_ofs] r.cx = pw.pcmload_pcmstop; r.cx -= pw.pcmload_pcmstart; r.cx += r.cx; r.cx += r.cx; r.cx += r.cx; r.cx += r.cx; r.cx += r.cx; r.dx = pw.port46; r.bx = pw.port47; if (pw.adpcm_wait == 0) { goto fast_store; } if (pw.adpcm_wait == 1) { goto middle_store; } //;------------------------------------------------------------------------------ //; 低速定義 //;------------------------------------------------------------------------------ slow_store :; // cli //o4600z: in al,dx // or al,al // js o4600z // mov al,8 ;PCMDAT reg. // out dx, al // push cx // mov cx, cs:[wait_clock] // loop $ // pop cx // xchg bx, dx // lodsb // out dx, al ; OUT data // sti // xchg dx,bx //o4601z: // in al,dx // test al,8 ;BRDY check // jz o4601z //o4601zb: // test al, al; BUSY check // jns o4601zc // in al,dx // jmp o4601zb //o4601zc: // mov al,10h // cli // out dx,al // push cx // mov cx,cs:[wait_clock] // loop $ // pop cx // xchg dx, bx // mov al,80h // out dx,al ;BRDY reset // sti // xchg dx,bx // loop slow_store // jmp pcmst_exit //;------------------------------------------------------------------------------ //; 中速定義 //;------------------------------------------------------------------------------ middle_store :; // call cli_sub //o4600y: in al,dx // or al,al // js o4600y // mov al,8 ;PCMDAT reg. // out dx, al //middle_store_loop: // push cx // mov cx, cs:[wait_clock] // loop $ // pop cx // xchg bx, dx // lodsb // out dx, al ; OUT data // xchg bx, dx //o4601y: // in al,dx // test al,8 ;BRDY check // jz o4601y // loop middle_store_loop // call sti_sub // jmp pcmst_exit //;------------------------------------------------------------------------------ //; 高速定義 //;------------------------------------------------------------------------------ fast_store :; cli_sub(); o4600x :; r.al = pc98.InPort(r.dx); if ((r.al & 0x80) != 0) { goto o4600x; } r.al = 8;//;PCMDAT reg. pc98.OutPort(r.dx, r.al); r.stack.Push(r.cx); r.cx = pw.pcmload_wait_clock; //do //{ //r.cx--; //} while (r.cx != 0); r.cx = r.stack.Pop(); ushort b = r.bx; r.bx = r.dx; r.dx = b; fast_store_loop :; r.al = pw.pcmDt[r.si++]; pc98.OutPort(r.dx, r.al);//; OUT data b = r.bx; r.bx = r.dx; r.dx = b; o4601x :; r.al = pc98.InPort(r.dx); //if ((r.al & 8) == 0)//;BRDY check //goto o4601x; b = r.bx; r.bx = r.dx; r.dx = b; r.cx--; if (r.cx != 0) { goto fast_store_loop; } sti_sub(); pcmst_exit :; r.dx = 0x1000; out46(); r.dx = 0x1080; out46(); r.dx = 0x0001; out46(); key_check_set(); }