[Coco] Interrupt Confusion

Brad Grier bradgrier at cox.net
Sun Jan 11 20:04:11 EST 2004


I'm having having a problem with two games in Mocha that appear to be 
interrupt related - just when I thought I had all that ironed out!

Here's my understanding of how things should work with regard to the 
60ms IRQ. Please let me know if I'm wrong.

bit 0 of 0xff03 must be set to 1 to enable the interrupt
bit 4 of the CC (IRQ Interrupt mask) must be set to zero for the cpu to 
process the interrupt.

When an interrupt occurs, bit 7 of 0xff03 is turned on - another 
interrupt cannot occur until a read of 0xff02 which clears bit 7 of 0xff03.

First question: if the CC register's IRQ mask is on, does an interrupt 
still fire (even though it's not processed by the CPU) causing bit 7 of 
0xff03 to be set? In other words, do 'unprocessed' interrupts continue 
to fire if the CC register's IRQ flag is on?

Here's what's going on - I revised the interrupt code in Mocha to work 
according to the rules as I understand them (I had known it wasn't right 
but most stuff still worked). As a result, the Cyrus Chess program 
stopped processing keystrokes. I found if I set bit 7 of 0xff03 after an 
interrupt but ONLY when the CC IRQ mask was on, the program would work 
fine. Before that, I was setting bit 7 as soon as mocha fired the IRQ 
(regardless of the state of CC register). I thought that fixed 
everything until...

"Temple Of ROM" now breaks. If I turn on bit 7 of 0xff03 everytime I 
fire an IRQ regardless of the CC register's IRQ mask, TOR will work but 
Cyrus breaks! In TOR, it appears the CC IRQ mask is always on meaning 
the 6809 isn't processing IRQs but the program is somehow dependent on 
bit 7 of 0xff03 being handled as if IRQs were firing. What's going on?

I must be missing something because I can't seem to find a solution that 
accomodates both of these programs.

Any help would be greatly appreciated!!!

Brad





More information about the Coco mailing list