Re: [cc65] Raster interrupts on Plus/4

From: Janne Peräaho <>
Date: 2015-03-13 18:05:26
13.3.2015, 14.59, Ullrich von Bassewitz wrote:
> Hi!
> On Fri, Mar 13, 2015 at 01:27:37PM +0200, Janne Peräaho wrote:
>> My interrupt program works otherwise except Plus/4 stops reading
>> the keyboard. More precisely I can't change between upper and lower
>> case letters by pressing C= + Shift when the program is running.
> I don't have a solution but some ideas:
> - If you're using the Plus/4 target, the program uses banking. You
> you sure anything is ok with the ROM being correctly banked in and
> so on?

I tried creating a C16 executable but the problem didn't go away.

> - Can this be because the routine leaves interrupts disabled?

At the end of my interrupt routine I request new raster interrupt by
clearing the interrupt status register (0xff09) and there are no SEI()
calls in the routine.

> - The generated C code isn't reentrant. I usually recommend against
> writing interrupt handlers in C. Are you sure you don't have a
> reentrancy problem?

Yes, quite sure. The main program is just an endless loop, it doesn't do
anything. The interrupt routine just changes the border color and the
background color so that I can see if the interrupts are working.

13.3.2015, 15.50, Oliver wrote:
> Hi,
> Wouldn't it be interesting to learn if set_irq() is used?
> - If 'no' then the C-written IRQ handler likely trashes zero page
> stuff of the main program.
> - If 'yes' then the C-written IRQ handler is supposed to return to
> the C-library stub and not jump to "somewhere" as then the zero page
> stuff of the main program isn't restored by the C-library stub.

I'm using old version of the cc65 (version 2.12.0) and it's missing the
set_irq function, so no. Just utilizing SEI() and CLI() to attach my
interrupt routine.

Any attempt to use local variables in the interrupt routine crashed the 
system immediately.

Are there any examples on how to use the set_irq function?

To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Mar 13 18:05:32 2015

This archive was generated by hypermail 2.1.8 : 2015-03-13 18:05:34 CET