I'm not sure exactly what the code is doing, but it looks like it stops getting some of the interrupts.

There's an interrupt routine at 2572 which will do a lda $c0a8 and if there isn't data to get it will do things like update the clock. When the clock freezes it must not be getting these interrupts, and once that happens then it only gets interrupts when a midi keyboard key is pressed, and the interrupt routine processes the key data instead.

./mame64 apple2p -sl2 midi -verbose -flop1 ../../Passport\ designs\ -\ Master\ tracks\ v1.8.dsk -debug -midiout "Portable Grand MIDI 1" -midiin "Portable Grand MIDI 1"

setting a breakpoint on the clock address "bp 96,1,w"


2676: lda $96                            $96 is the lowest part of the clock, goes from 0-23 and then cycles back to 0
2674: inc $96
2671: sta $c0a8
266F: lda #$b1
266D: inc $04
266B: sta ($04), y
2669: lda #$f8
2667: sta $a0
2665: lda $a1
2662: sta $c0ae
2660: bne $26d6
265E: dec $a0
265C: bmi $26d6
265A: bit $af
264E: bpl $265a
264C: bit $88
2608: bmi $264c
2606: bit $92
2604: beq $264c
2602: cmp $00
2600: lda $08
25FE: ldy #$00
25FD: cli
25FA: lda $c0a4
25F7: lda $c0a1
257E: jmp $25f7             so it jumps to 25f7
257C: bmi $2581            no data to get
2579: lda $c0a8                    
2578: pha
2577: tya
2576: pha
2575: txa
2574: pha
2572: lda <ACC
BFFC: jmp ($03fe)              3FE points to 2572
BFFA: sta <ACC                   interrupt gets called here, FFFE vector points to BFFA

If I don't touch any of the keys, the clock will run fine. Then if I start playing a bunch of keys it stops the clock.

When the clock stops you can manually change location $96 and the screen will update, so the main display loop is running, but it isn't getting the constant interrupts that would make the clock update.

Last edited by Golden Child; 05/31/19 01:36 PM.