[Coco] Assembly: timing, vsync

Tormod Volden lists.tormod at gmail.com
Sat Apr 16 15:28:46 EDT 2016


On Sat, Apr 16, 2016 at 12:21 AM, Ricardo M. Ferreira wrote:
> 1) "Timer"
>
> From what I read and tested on a Coco 2 emulator (Xroar), the "timer" at
> $0112:0113 seems to be updated after every screen refresh. So, it changes at
> 60 Hz on NTSC devices ("xroar -default-machine cocous"), and 50 Hz on PAL
> ("xroar -default-machine coco").
>
> I want to write a program that is time sensitive. Is this the only timer in
> the Coco 2? If so, is there any way for my program to figure out the timer
> frequency (if it is 50 Hz or 60 Hz)?

I was going to write a 50/60Hz detection routine for FUZIX anyway, so
I can give you the following working example:
https://gitlab.com/m6809-computer-tools/various-6809/blob/master/bogomips.asm
It counts CPU cycles between two vsync interrupts and can therefore
tell if you are on 50 or 60 Hz and 0.9 or 1.8 MHz. The program stores
the final counter value at $0C00 and prints a letter to indicate the
result.

Regards,
Tormod


More information about the Coco mailing list