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

Re: IIGS tech questions...



[My ISP just decided to drag this post out of its bit-bucket - I hadn't
seen it before now.]

Bryan Parkoff <nospam@nospam.com> wrote:

> David,
> 
> > I recall that $C029 (NEWVIDEO) has to be modified using
> > read-modify-write, specifically so you don't change the state of bit 0
> > (it is normally set). If you clear it, the system will usually crash.
> 
>     Do you have an explanation why read-modify-write is needed?  

As I stated - if you just blindly store a specific value to that
register without knowing its previous value, you might accidentally
change the state of a bit you didn't want to modify.

The only bits applications should be playing with in NEWVIDEO (as far as
I can recall) are bits 7 and 6, which control SHR display and linear
memory mapping for the $E1/2000-9FFF video buffer region.

The correct procedure is LDA, ORA/AND to modify the appropriate bits,
then STA.

I don't recall what bits 1 through 5 do. If some of those are persistent
mode bits then they should be left alone while you are changing bits 6
and 7.

If you have prior knowledge of what all the other bits are supposed to
be, in all environments under which your code might be executing, then
it arguably OK to directly store a specific value, but I'd still prefer
to use the read-modify-write sequence for consistency.

> Without read-modify-write like LDA and STA will crash.  It requires AND or
> ORA to clear or set individual bit.  I would wish to reproduce crashes in
> Apple IIgs Emulator.

The specific problem with this register (as far as I recall) is bit 0. I
don't remember exactly what it does, but I think it is something major
like memory mapping of I/O, access to bank $E1, or control of shadowing
in banks other than 0 and 1.

I'd have to unbury my manuals or find my notebook to be able to supply
more details. Maybe someone else can fill in the blanks.

-- 
David Empson
dempson@actrix.gen.nz