Greetings,

I'm starting to evaluate using Agar for an emulator I'm writing for my
classic computer of choice (TI-99/4A) and I have a few questions.  I have
the CPU almost done and it's time to get it out of command line mode and
into a GUI (so I can do the VDP and start having more fun [image: Smile] ).

My primary problem right now is that I need a 60Hz VDP interrupt, and also
to draw the primary display (the generated 256x192 screen image) at 60
frames per second (as in the original hardware).  There are some other I/O
timing signals that need to be accurate as well.

I'm considering Agar because, from what I have read so far, it meets two of
the design goals I'm not willing to give up:

1. Cross-platform.  I want the MAC and Unix group to enjoy the emulator as
well, not limited to just the Windows bunch.
2. A GUI.  I'm planning to add things to my emulator like a debugger, memory
inspector, disassembler output, virtual file manager, and other such useful
developer stuff. All that will require a hefty amount of GUI and dialogs,
which is where Agar looks like it will "fit the bill" nicely.

Questions:

1. Should I consider a custom event loop to better control the VDP
interrupt?  What about implementing it as a thread?  I'm going to update the
emulated video at 60Hz regardless of whether or not the emulated CPU or
other parts of the emulator are throttled to the original speed, or running
full-out.  This should keep the display stable even if the system is running
virtually over-clocked.  Ideally I'd be able to time the VDP display update
and interrupt at exactly 16.6ms, but it seems that to get sub-millisecond
timing requires OS specific code to the high-resolution timer.  Kind of
baffles me that a modern 1GHz or faster computer has a hard time providing a
reliable timer better than 1ms.  Never understood it.


2. What would be the best type of control (widget) for the virtual video
display?  The 256x192 frame will have to be generated pixel-by-pixel,
programmatically, using the code I'm writing that emulates the original
VDP.  I would also like to allow the user to enlarge the virtual display, so
once the 256x192 frame is created, I'll need a simple resize and blit to
whatever surface is best suited for this type of updating.

Any insight would be greatly appreciated.

Thanks,
Matthew
_______________________________________________
Agar mailing list
[email protected]
http://libagar.org/lists.html

Reply via email to