--- xmil/io/sndboard.c 2004/08/12 17:57:36 1.5 +++ xmil/io/sndboard.c 2008/06/02 20:07:31 1.7 @@ -2,28 +2,31 @@ #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; REG8 reg; lsb = (UINT8)port; - if (lsb == 0x00) { // 0700 + if (lsb == 0x00) { /* 0700 */ sndboard.opmreg = (UINT8)dat; } - else if (lsb == 0x01) { // 0701 + else if (lsb == 0x01) { /* 0701 */ 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 + else if ((lsb & (~3)) == 0x04) { /* 0704-0707 */ ctc_o(port, dat); } } @@ -33,16 +36,17 @@ REG8 IOINPCALL opm_i(UINT port) { REG8 lsb; lsb = (UINT8)port; - if ((lsb & (~1)) == 0x00) { // 0700/0701 - return(0x00); // ゼリアード + if ((lsb & (~1)) == 0x00) { /* 0700/0701 */ + return(0x00); /* ゼリアード */ } - else if ((lsb & (~3)) == 0x04) { // 0704-0707 + else if ((lsb & (~3)) == 0x04) { /* 0704-0707 */ return(ctc_i(port)); } else { 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; } @@ -95,8 +101,9 @@ REG8 IOINPCALL sndboard_psgsta(UINT port } -// ---- +/* reset */ +#if !defined(DISABLE_SOUND) void sndboard_update(void) { UINT i; @@ -104,15 +111,18 @@ void sndboard_update(void) { 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(); }