--- xmil/sound/psggenc.c 2004/08/01 05:31:31 1.1 +++ xmil/sound/psggenc.c 2004/08/17 15:43:34 1.5 @@ -2,17 +2,11 @@ #include #include "sound.h" #include "sndctrl.h" -#include "juliet.h" -#include "x1f.h" - - -extern int s_cnt; -extern DWORD basedclk; PSGGENCFG psggencfg; -static const UINT8 psggen_deftbl[0x10] = +const UINT8 psggen_deftbl[0x10] = {0, 0, 0, 0, 0, 0, 0, 0xbf, 0, 0, 0, 0, 0, 0, 0xff, 0xff}; static const UINT8 psgenv_pat[16] = { @@ -93,16 +87,10 @@ void psggen_setreg(PSGGEN psg, REG8 reg, UINT freq; UINT ch; - x1f_psg(reg, value); - if (romeo_exist) { - juliet2_YMF288A(reg, value, (basedclk * s_cnt / 1600)); + if (reg >= 14) { return; } - - reg &= 15; -// if (reg < 14) { -// sound_sync(); -// } + sound_sync(); ((UINT8 *)&psg->reg)[reg] = value; switch(reg) { case 0: @@ -118,6 +106,7 @@ void psggen_setreg(PSGGEN psg, REG8 reg, } else { psg->tone[ch].freq = 0; + psg->tone[ch].count = 0; // としておかないとノイズ出ない } break; @@ -134,7 +123,6 @@ void psggen_setreg(PSGGEN psg, REG8 reg, // keydisp_psgmix(psg); psg->mixer = ~value; psg->puchicount = psggencfg.puchidec; -// TRACEOUT(("psg %x 7 %d", (long)psg, value)); break; case 8: @@ -150,7 +138,6 @@ void psggen_setreg(PSGGEN psg, REG8 reg, } psg->tone[ch].puchi = psggencfg.puchidec; psg->puchicount = psggencfg.puchidec; -// TRACEOUT(("psg %x %x %d", (long)psg, reg, value)); break; case 11: