--- np2/io/iocore.c 2005/02/12 12:40:39 1.21 +++ np2/io/iocore.c 2005/04/08 19:39:09 1.22 @@ -68,8 +68,16 @@ static UINT8 ioterminate[0x100]; static void IOOUTCALL defout8(UINT port, REG8 dat) { #if !defined(DISABLE_SOUND) - if ((port & 0xfff0) == cs4231.port) { - cs4231io_w8(port, dat); + UINT tmp; + + tmp = port - cs4231.port[0]; + if (tmp < 8) { + cs4231io0_w8(port, dat); + return; + } + tmp = port - cs4231.port[5]; + if (tmp < 2) { + cs4231io5_w8(port, dat); return; } #endif @@ -83,8 +91,15 @@ static void IOOUTCALL defout8(UINT port, static REG8 IOINPCALL definp8(UINT port) { #if !defined(DISABLE_SOUND) - if ((port & 0xfff0) == cs4231.port) { - return(cs4231io_r8(port)); + UINT tmp; + + tmp = port - cs4231.port[0]; + if (tmp < 8) { + return(cs4231io0_r8(port)); + } + tmp = port - cs4231.port[5]; + if (tmp < 2) { + return(cs4231io5_r8(port)); } #endif if ((port & 0xf0ff) == 0x801e) {