--- xmil/io/sndboard.c 2004/08/08 06:59:22 1.4 +++ xmil/io/sndboard.c 2005/02/04 06:42:11 1.6 @@ -2,12 +2,13 @@ #include "joymng.h" #include "pccore.h" #include "iocore.h" +#include "keystat.h" #include "sound.h" #include "sndctrl.h" -#include "keystat.h" #include "x1f.h" +#if defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM) void IOOUTCALL opm_o(UINT port, REG8 dat) { REG8 lsb; @@ -21,7 +22,9 @@ void IOOUTCALL opm_o(UINT port, REG8 dat reg = sndboard.opmreg; sndboard.opmdat[reg] = dat; x1f_opm(reg, dat); +#if !defined(DISABLE_SOUND) opmgen_setreg(reg, dat); +#endif } else if ((lsb & (~3)) == 0x04) { // 0704-0707 ctc_o(port, dat); @@ -43,6 +46,7 @@ REG8 IOINPCALL opm_i(UINT port) { return(0xff); } } +#endif void IOOUTCALL sndboard_psgreg(UINT port, REG8 dat) { @@ -59,7 +63,9 @@ void IOOUTCALL sndboard_psgdat(UINT port if (reg < 0x0e) { sndboard.psgdat[reg] = dat; x1f_psg(reg, dat); +#if !defined(DISABLE_SOUND) psggen_setreg(&psggen, reg, dat); +#endif } (void)port; } @@ -97,10 +103,26 @@ REG8 IOINPCALL sndboard_psgsta(UINT port // ---- +#if !defined(DISABLE_SOUND) +void sndboard_update(void) { + + UINT i; + + for (i=0; i<14; i++) { + psggen_setreg(&psggen, (REG8)i, sndboard.psgdat[i]); + } +#if defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM) + for (i=0x20; i<0x100; i++) { + opmgen_setreg((REG8)i, sndboard.opmdat[i]); + } +#endif +} +#endif + void sndboard_reset(void) { ZeroMemory(&sndboard, sizeof(sndboard)); - CopyMemory(sndboard.psgdat, psggen_deftbl, sizeof(psggen_deftbl)); + sndboard.psgdat[0x07] = 0x3f; sndctrl_reset(); }