[Coco] MAME debugger & beamy

David Broman davbrdavbr at hotmail.com
Wed Sep 13 22:23:29 EDT 2023


Hi, all, I'm trying to get a deeper understanding of the VSYNC interrupt, and I'm using the MAME debugger to verify my understanding.  I'm seeing some unexpected values for the debugger's "beamy" value, and I'm hoping someone knows why?

If I just start up a coco2 with disk extended basic 1.1 in MAME (no programs loaded), I'd expect that the only IRQ I'll see is the FS (i.e., vsync 60Hz) interrupt.  And sure enough, if I hit F7 ("run until next interrupt") the debugger shows that (1) the frame has advanced by 1 each time (upper-left corner above registers), (2) the CPU breaks at $010C each time (location where IRQ sends the CPU), and bit 7 of $FF03 is set each time (indicating the FS IRQ).  That's all great and makes sense.

What's odd is "beamy".  I'd expect it to be roughly the same (and near where VBLANKing starts) each time.  But instead, if I hold down F7 (auto-repeat) I can see beamy slowly creeping up through every possible value.  It's as if the IRQ is sent with a frequency not of the total number of scan lines, but about ONE MORE than the total number of scan lines, so that with each new IRQ, the beam has cycled through an entire field PLUS an extra scan line.  It doesn't bounce back and forth--it just keeps going up at each interrupt.  Anyone know why?

One more mystery.  If I use MAME's F8 ("Run until next VBLANK"), beamy is consistently 241.  I like that it's consistent (unlike the F7 experiment).  But according to the MC6847 data sheet Figure 13 (p. 11), VBLANK begins after 13 + 25 + 192 = 230 lines from the very top.  Unless I'm misinterpreting?  Anyone know?

Thanks for your help, and sorry for the long email!


Dave (Coco Town)


More information about the Coco mailing list