Ok, I added little error description to the test ROM. It looks like the read data on open-bus addresses is high byte of previous opcode, so maybe the pull-down are not strong as I previously thought.
Here are some waveform from the code:
Code: Select all
lda #1 ; just to make easy triggering in scope
sta $4016 ; just to make easy triggering in scope
lda #0 ; just to make easy triggering in scope
sta $4016 ; just to make easy triggering in scope
lda (zp_ptr1), y ; this should read value from cell $4018
; and the result is $40
CH1=M2, CH2=R/W, CH3=OUT0, CH4=D6
The voltage on D6 in cycle 5 is slowly decreasing, maybe too slow for read it as 0V (kazzo read operations are much slower)
BTW. It turns out that writing value to $4016 (joypad strobe) makes it appear on the end of NEXT cycle. Weird.
Lol no, it is random, in some power-ups t happens at the end of the write cycle and in some at the end of next one.
Why are interrupts failing on the real cartridge?
I expected the interrupt to happen after 17 loops of polling value set by IRQ interrupt routine, but on real cartridge it happened after 14 loops.
Code: Select all
lda #0
sta irq_arrived1
ldx #0
lda #10
sta $7efd
lda #0
sta $7efe
sta $7eff
cli
sta $7efe
lda #3
sta $7efe
test11_loop:
inx
beq test11_fail_noirq ;if no irq happends in 256 loops, consider it not working at all
lda irq_arrived1
beq test11_loop
cpx #$14
bne test11_fail_badirqcounter
...
irq_vector_handler:
pha
lda #1
sta irq_arrived1
lda #0
sta $7efe
pla
rti