[Coco] IRQ question

Arthur Flexser flexser at fiu.edu
Wed Feb 1 23:20:48 EST 2017


You say your IRQ service routine is big.  Could it possibly be SO big that
servicing takes more than a 60th of a second on the CoCo 3?  That would
certainly cause some IRQ servicings to be skipped.  Or even if servicing
took slightly under a 60th of a second, the next IRQ would hit almost
immediately after return from the previous service, so little code could be
executed in between, causing a substantial slowup.

You could count cycles in the service routine to closely estimate how long
servicing should take in the CoCo 3 double-speed mode.

Art

On Wed, Feb 1, 2017 at 9:55 PM, Glen Hewlett <glen.hewlett at sympatico.ca>
wrote:

> Hi All,
>
> I need some help from a CoCo3 IRQ expert.
>
> I thought I had this figured out but something is not right with my IRQ
> setting for my Pac Man transcode project.  I’ve gotten to the first attract
> mode and the animation is running about 1/4 the speed of the real machine.
> I was getting worried it was a problem with the CPU not being fast enough
> but it looks like the IRQ just isn’t kicking in at the correct time.  It
> seems to update the IRQ on the CoCo 3 every 4 frames and not when the
> VBLANK occurs at least according to MAME in debug mode.  What I need is it
> to be triggered on every VBLANK or (VSYNC)
>
> On Pac man hardware the IRQ kicks in approximately 60 times a second and
> using MAME debugger option I can see it in action, every IRQ it does is one
> frame.  On the CoCo 3 under MAME debugger running my code it seems to kick
> in around every 4th frame and definitely not when the beamy is at 241 like
> pac man shows under MAME debug mode.  I know MAME might not be perfect but
> there is definitely something wrong with my IRQ settings.  I’ve setup the
> following code for my IRQ thinking it should trigger on the VBORD, is this
> the same as VBLANK?
>
>         LDA     #%00110100              *
>         STA     $FF01                   * HSYNC IRQ Disabled, IRQ Polarity
> Flag falling Edge, Data Direction Normal, Select Line LSB = 0, HSYNC Flag =
> 0
>         STA     $FF03                   * VSYNC IRQ Disabled, IRQ Polarity
> Flag falling Edge, Data Direction Normal, Select Line MSB = 0, VSYNC Flag =
> 0
>         STA     $FF21                   * CONTROL OF CD FIRQ* TO CPU
> DISABLED, IRQ Polarity Falling Edge of CD, CD Flag off
>         STA     $FF23                   * CONTROL OF Cart FIRQ* TO CPU
> DISABLED, IRQ Polarity Falling Edge of Cart, Cart Flag off
>
>         LDA     #%01101100              *
>         STA     $FF90                   * CoCo 3 Mode, MMU Enabled, GIME
> IRQ Enabled, GIME FIRQ Disabled, Vector RAM at FEXX enabled, Standard SCS
> Normal, ROM Map 16k Int, 16k Ext
>         LDA     #%00000000              *
>         STA     $FF91                   * Mem Type 64k chips, 63.695 usec
> timer, MMU Task 0 - $FFA0-$FFA7
>
>         LDA     #%10000000              *
>         STA     $FF98                   * Graphics mode, Colour output, 60
> hz, max vertical res
>
>         LDA     #%00001000              * $08
>         STA     $FF92                   * Enable only the Vertical Border
> Sync (VBORD) Interrupt
>
> The IRQ routine itself is big… Other then running normal code I’m only
> doing the following in the IRQ routine itself:
> IRQ starts…
>         No special code here
>
> At the end of the IRQ I have:
>         LDA     $FF92                  * Reading this makes the IRQ
> enabled again
>         RTI
>
> Does the above look OK for setting the IRQ to hit 60 times a second on the
> VBLANK signal?  If so then maybe the CoCo 3 just isn’t fast enough to run
> my Pac Man translated code.  :(
>
> Thanks for looking,
> Glen
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>


More information about the Coco mailing list