[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mix LGR and Text?



Linards Ticmanis wrote:
Jorge Chamorro Bieling wrote:

In order to switch in/out a *known*, fixed band of every single picture
frame you'd need to be able to lock to the vertical sync. If not, you
can only be sure that you're switching in/out a certain portion of the
frame at the right frequency. I believe IIe's have had vsync
memory-mapped, but i can not figure out how did you manage to know when
it's vsync-time on an a2, a2+ ?


AFAIK, you store certain values in the last few bytes of the visible screen and make sure those values are nowhere else in your screen. Then you keep reading some unconnected I/O location. Since nothing is driving the data bus when you read those, the data that the video display circuitry put on the bus will still be there for the CPU to see. As soon as you see your data, you're locked in and then you only have to keep your cycle counts.

Also, being such a time-critical loop, if not interrupt-driven, there's
not much you can do while in-the-loop, or the whole thing stops being
in-sync... ?


Given that for example on the Atari 2600, all programs have to do stuff like this to get anything to display at all, and given that people nevertheless managed to cook up about a thousand games for the thing, I'd say there is quite a lot you can do -- if you're masochistic enough for this kind of coding, that is.

Indeed!

RT.SYNTH and CrateSynth both must maintain a continuous stream of
6-cycle pulses every 46 cycles when not playing a sound. When a
sound is played, the pulses still must occur every 46 cycles, but
their widths vary with the sample values.

NadaNet data sending and receiving is another extremely time-critical
situation.  I invite interested readers to take a look at the *very*
clever SENDPKT routine devised by Stephen Thomas for NadaNet 2.0.

Another such example, using the DPLL technique, is his 5.25" disk
track read routine, posted here recently.

Programming in such a rigid timing environment is a very interesting
challenge, which causes one to prefer "constant time" algorithms for
incrementing pointers, range-checking, etc.  It is more difficult,
but the problems are quite entertaining for the devious mind.  ;-)

-michael

Music synthesis for 8-bit Apple II's!
Home page:  http://members.aol.com/MJMahon/

"The wastebasket is our most important design
tool--and it is seriously underused."