[Coco] CoCo 3 keyboard interrupt

William Astle lost at l-w.ca
Thu Oct 25 17:43:52 EDT 2018


That doesn't actually enable the GIME IRQ (in $FF90). Thus, your IRQ 
routine is only running during the standard PIA VSYNC interrupt. If you 
enable the IRQ enable bit in $FF90 (and don't return to Basic because 
Basic is pretty annoying about resetting the GIME registers every time 
it outputs any text), you'll probably find you cycle through multiple 
colours for each keypress. And also, if you have a counter running 
outside the interrupt handler, it probably stops while you have a key down.

All that said, this program should show whether the keyboard interrupt 
status is working properly since if the status bit in FF92 works, then 
the interrupt should fire when enabled in FF90.

The CLR $FF02 is to make sure all keyboard columns are active so that a 
key press in any column can cause a change in $FF00.

On 2018-10-25 2:53 p.m., Robert Gault wrote:
> Tim,
> 
> This may not be the best example of the technique but I tested it on a 
> real Coco3 and the border color changes with a key press.
> 
> * Test of keyboard IRQ
> 
>      ORG    $7000
> START    ORCC    #$50
>      LDA    #2    SETUP KEY IRQ
>      STA    $FF92
>      CLR    $FF02    MAY NOT BE NEEDED
>      LDX    #IRQV    INSTALL OUR K-IRQ ROUTINE
>      STX    $FEF8
>      LDA    #$7E    JMP
>      STA    $FEF7
>      CLR    COLOR    DATA BYTE
>      ANDCC    #$AF
>      RTS
> 
> IRQV    LDA    $FF92    TEST FOR A KEY IRQ
>      BITA    #2
>      LBEQ    $10C    IF NOT KEY DO NORMAL IRQ
>      INC    COLOR    IT WAS A KEY STROKE
>      LDA    COLOR
>      STA    $FF9A    CHANGE BORDER COLOR
>      RTI        RETURN FROM IRQ
> 
> COLOR    FCB    0
>      END    START
> 
> 
> tim lindner wrote:
>> Does any one have code prepared to test the keyboard interrupt? Or
>> know of a program that uses it?
>>
>> I’ve heard reports it is broken in MAME. I’d like to fix it.
>>
> 



More information about the Coco mailing list