From 04de059478c9b51404df92267fd13242d75bb276 Mon Sep 17 00:00:00 2001 From: Klaus2m5 Date: Fri, 15 Aug 2014 18:21:06 +0200 Subject: [PATCH] added feedback filter feedback of bit7 to the emu diag register will cause an unwanted diag stop (since emu version 0.83). Added a filter to compensate. --- 6502_interrupt_test.a65 | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/6502_interrupt_test.a65 b/6502_interrupt_test.a65 index 4715c3a..bfc3754 100644 --- a/6502_interrupt_test.a65 +++ b/6502_interrupt_test.a65 @@ -20,7 +20,7 @@ ; This program is designed to test IRQ and NMI of a 6502 emulator. It requires ; an internal or external feedback register to the IRQ & NMI inputs ; -; version 16-aug-2013 +; version 15-aug-2014 ; contact info at http://2m5.de or email K@2m5.de ; ; assembled with AS65 from http://www.kingswood-consulting.co.uk/assemblers/ @@ -49,6 +49,7 @@ ; versions: ; 19-jul-2013 1st version distributed for testing ; 16-aug-2013 added error report to standard output option +; 15-aug-2014 added filter to feedback (bit 7 will cause diag stop in emu) ; C O N F I G U R A T I O N @@ -67,6 +68,7 @@ I_ddr = 0 ;feedback DDR address, 0 = no DDR I_drive = 1 ;0 = totem pole, 1 = open collector IRQ_bit = 0 ;bit number of feedback to IRQ NMI_bit = 1 ;bit number of feedback to NMI, -1 if not available +I_filter = $7f ;filtering bit 7 = diag stop ;typical IO chip port B - set i_drive = 0 to avoid pullup resistors ;I_port = $bfb2 ;feedback port address @@ -74,9 +76,10 @@ NMI_bit = 1 ;bit number of feedback to NMI, -1 if not available ;I_drive = 1 ;0 = totem pole, 1 = open collector ;IRQ_bit = 0 ;bit number of feedback to IRQ ;NMI_bit = 1 ;bit number of feedback to NMI, -1 if not available +;I_filter = $ff ;no bits filtered ;decimal mode flag during IRQ, NMI & BRK -D_clear = 1 ;0 = not cleared (NMOS), 1 = cleared (CMOS) +D_clear = 0 ;0 = not cleared (NMOS), 1 = cleared (CMOS) ;configure memory - try to stay away from memory used by the system ;zero_page memory start address, 6 consecutive Bytes required @@ -242,7 +245,7 @@ ld_vect lda vec_init,x if I_drive = 0 ;totem pole (push/pull, 0 -> I_port to force interrupt) I_set macro ibit ;ibit = interrupt bit lda I_port ;turn on interrupt by bit - and #$ff-(1<<\1) + and #I_filter-(1<<\1) plp ;set flags pha ;save to verify php @@ -250,12 +253,14 @@ I_set macro ibit ;ibit = interrupt bit endm I_clr macro ibit ;ibit = interrupt bit lda I_port ;turn off interrupt by bit + and #I_filter ora #(1< 7 ;set both NMI & IRQ - and #$ff-(1< 7 ;set both NMI & IRQ ora #(1< 7 ;set both NMI & IRQ ora #(1<