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

Re: Can the IIgs output colour on its composite monitor output?



Roger Johnstone <rojaws@mac.com> wrote:

> [No hardware shaowing for text page 2]
>
> However, if a program does use text page 2 you'll just get a screen full
> of '2's. Apple fixed it by adding the Alternate Display Mode desk
> accessory to ROM. Turn it on and it will continually copy text page 2 to
> the correct bank, but it will slow your IIgs down a lot too since it has
> to do it with a software routine.

A detail snippet here: Alternate Display Mode (on a ROM 0 or ROM 1
machine) works by setting up a VBL (vertical blanking) interrupt task to
copy the screen area on a regular basis.  I don't know how often it
runs, but the maximum rate would be 50 or 60 times per second, depending
on the video refresh rate.

It has to copy at least 960 bytes to get all of the displayed area (it
might avoid copying the screen holes).  I don't know whether it also
shadows auxililiary memory (for 80-column text page 2), but I doubt it,
since this would be an extremely rarely used mode.

Determining the execution time of this code is a little complicated,
because the code is running from ROM, reading data from fast RAM and
writing data to slow RAM.  Assuming the machine is in fast mode, ROM
reads can go at full speed (2.8 MHz), fast RAM reads may be delayed by a
refresh cycle (averaging out to about 2.6 MHz), and slow RAM writes are
at 1 MHz.

Assuming they use the MVN instruction, which takes 7 CPU cycles per byte
copied, and the machine is in fast mode, then it would take about 3 ms
to copy the screen.  They might have used an unrolled loop in order to
copy the data faster than this, but I don't think they could get it
faster than about 2.5 ms.

If this task ran every screen refresh, then at 60 Hz (16.67 ms per
refresh) it would be consuming about 18% of the CPU time (assuming 3 ms
per copy).  I'd say this is about right from my observations of the
speed penalty.

If a program disables interrupts, then this code will not be able to
execute, and text page 2 will be frozen showing the last updated
content.

> In the 1MB IIgs (ROM 3) they fixed the shadowing problem so Alternate
> Display Mode was no longer needed.

The CDA is still available, but all it does is set the state of the
hardware shadowing enable.  (It might also do a one-off copy of the
content of text page 2 when you enable alternate display mode.)