mos6522: implement edge-triggering for CA1/2 and CB1/2 control line IRQs
commitb793b4ef8c862891c716cd163aaa7e4af0d697da
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Sat, 5 Mar 2022 15:09:56 +0000 (5 15:09 +0000)
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Wed, 9 Mar 2022 09:28:28 +0000 (9 09:28 +0000)
tree1e67cac8ca64381fe32c6146edf09756cfa0f4ff
parent677a4725b1c49b139b00d8eaa932676ed8620931
mos6522: implement edge-triggering for CA1/2 and CB1/2 control line IRQs

The mos6522 datasheet describes how the control lines IRQs are edge-triggered
according to the configuration in the PCR register. Implement the logic according
to the datasheet so that the interrupt bits in IFR are latched when the edge is
detected, and cleared when reading portA/portB or writing to IFR as necessary.

To maintain bisectibility this change also updates the SCSI, SCSI data, Nubus
and VIA2 60Hz/1Hz clocks in the q800 machine to be negative edge-triggered as
confirmed by the PCR programming in all of Linux, NetBSD and MacOS.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20220305150957.5053-12-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
hw/m68k/q800.c
hw/misc/mac_via.c
hw/misc/mos6522.c
include/hw/misc/mos6522.h