From 52a8ab6014e54f9900df03eda349901b00a13226 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Thu, 19 Mar 2009 06:16:34 +0000 Subject: [PATCH] From: Robert [mailto:pac0446@bigpond.net.au] Sent: Sunday, March 15, 2009 5:23 AM To: Mamedev submit Subject: Fx to z80pio When outputting from a port to the hardware in pio mode 3, only those bits defined by the mask should be output. Mame currently outputs everything. New source code (z80pio.c) attached. Regards, Robbbert --- src/emu/machine/z80pio.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/emu/machine/z80pio.c b/src/emu/machine/z80pio.c index 213b7f97554..f6a7aa008ad 100644 --- a/src/emu/machine/z80pio.c +++ b/src/emu/machine/z80pio.c @@ -270,7 +270,12 @@ WRITE8_DEVICE_HANDLER( z80pio_d_w ) z80pio->out[offset] = data; /* latch out data */ if(z80pio->port_write[offset]) - z80pio->port_write[offset](device, 0, data); + { + if (z80pio->mode[offset] == PIO_MODE3) + z80pio->port_write[offset](device, 0, data & ~z80pio->dir[offset]); + else + z80pio->port_write[offset](device, 0, data); + } switch (z80pio->mode[offset]) {