[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Apple emulators that support "floating bus" video sensing?
mdj wrote:
On Mar 18, 5:20 pm, "Michael J. Mahon" <mjma...@aol.com> wrote:
The objective is not to do something sophisticated, like avoid tearing
of the animation (though that would be nice), but simply to cause it to
run at its intended speed, regardless of the speed of the processor
(emulated or real).
Polling VBL works on an Apple //e, but *only* on a //e, since later
machines de-implemented VBL polling in favor of VBL interrupts.
Actually, this isn't strictly true. On a IIe, the $C019 softswitch
will read with the high order bit set during (and only during) the
vertical blanking interval. On a IIc, the same softswitch will read
with the high order bit set if a VBL interrupt has occurred since the
last time it was read.
For practical purposes, being either waiting for VBL to draw, or using
it as a real time event source, software that polls the softswitch
will behave identically on both machines, assuming you read the
softswitch at least every 1/60th of a second.
But if you read it *very* often, while polling, you would observe only
one instance of the high bit set, right? And is it only set "if a VBL
interrupt has occurred"? If so, that would be a problem if I don't
want VBL interrupts to occur.
That's actually pretty different behavior, since the normal way to use
it is to poll for one state, then poll for the other. (This is to allow
the polling routine to be re-called before the polled-for state ends.)
The catch is, $C019 is also used to indicate mouse button and movement
activity whilst the mouse firmware is active, so you cannot reliably
poll it on a IIc if your program is also using the mouse.
A complication, but one I'd be willing to ignore for my uses... ;-)
I'm not 100% sure since I don't have a IIc handy that I can test with,
but I also have an inkling that VBL interrupts must be active for this
to work on a IIc ($C05A disable, $C05B enable), and I'm relatively
sure they're disabled by default. Of course, you also have to ensure
(processor) interrupts are disabled or the firmware is going to handle
them for you...
Ah, there's the rub. I really wouldn't want to enable VBL interrupts.
I guess Apple decided that the relatively short amount of time the IIe
spent in the wild before the IIc appeared meant it was OK to change
the behaviour? Most software would have used the floating bus method
to remain II/II+ compatible so the impact on developers was minor.
That was my thinking, as well, and why I decided to go with the floating
bus approach to detecting video frames.
And for the IIgs? I have no idea... Can someone shed some light?
I must admit I am *very* curious about what it is you're trying to
achieve that requires both the possibility of an accelerator being
operational *and* a real time clock source .... ;-)
Actually, pretty simple. I'd like to run an animation at a certain
rate independent of processor speed, but get the benefit of any
acceleration that may be present when searching the game tree.
-michael
NadaPong: Network game demo for Apple II computers!
Home page: http://members.aol.com/MJMahon/
"The wastebasket is our most important design
tool--and it's seriously underused."