Re: Commodore joystick ports

From: Marko Mäkelä (marko.makela_at_hut.fi)
Date: 2004-11-03 22:01:06

On Wed, Nov 03, 2004 at 08:34:17AM -0600, Jim Brain wrote:
> >You didn't mention one trick that Andreas Boose once told me: the double
> >interrupt trick.  Set up two interrupts.  The first one would be served 
> >with
> >some jitter, and the second one would be triggered while the first one is
> >executing NOP instructions.  On the 6502, you'd have to get rid of the 0..1
> >cycle jitter in the second interrupt because the shortest instructions take
> >2 cycles, but on the AVR the first interrupt can be executing 1-cycle
> >instructions, and the second interrupt will be cycle-exact.
> > 
> >
> This is a neat idea (I'll stuff it in my bag of tricks), but I'm not 
> sure how to discern the 3 cycle jitter, as my first IRQ is the detection 
> of the falling edge of the POT line.

You're right, it doesn't really work with anything except periodic interrupts
that are derived from the processor clock, such as raster or timer interrupts
on 8-bit Commodore computers.

Andreas mentioned an even uglier trick: Trigger a light pen interrupt by
programming the CIA I/O pin connected to it, and hope that the user doesn't
press space or the fire button in joystick port #1.  That trick is used in
the Technolo-G demo by Steel (http://www.funet.fi/pub/c64/demos/pal/Steel/).

I didn't follow your and Levente's discussion in detail, but I guess there is
some reason why you can't use the input capture register.

	Marko

       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.