<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Tue, 07 Dec 2004 10:00:08 +0000
From   : Richard_Talbot-Watkins@...
Subject: Re: mode switching

jgh wrote on 07/12/2004 08:39:14:

> You need to program the CRTC (Cathode Ray Tube Controller) and the
VIDPROC
> (video processor). You will only be able to use the VDU to write to
screen
> in one of the MODEs. It is easier to POKE messages to a MODE 7 screen, so
> use real MODE 1 and a fake MODE 7.
>
> The following program demonstates using &3000-&7BFF to hold MODE 1
> contents and &7C00-&7FFF to hold MODE 7 contents without clearing either
> of them.
>
> [code snipola]

Yes, this is a much better solution than mine.  Setting the VDU variables
is the tricky bit, but letting the OS initialise it for Mode 1 and then
poking directly for a fake Mode 7 is infinitely preferable!

> If you are writing in machine code and know your program owns the
hardware
> and is running in the I/O processor, it is more efficient to write the
> data directly to the controllers:
>
> .ModeSetup                          :\ On entry, X=table offset
> LDY #0                              :\ Start at register 0
> .MSLoop
> LDA ModeTable,X:STY &FE00:STA &FE01 :\ Program CRTC
> INX:INY:CPY #16:BNE MSLoop          :\ Write 16 registers
> LDA ModeTable,X:STA &FE20           :\ Write VIDPROC value
> RTS

Beware of writing directly to &FE20.  If the OS IRQ handlers *ever* get a
look in, they will return ?&FE20 back to what they think it should be for
the current mode.  This is weird but seems to happen for some reason (on a
Master at least).  Safer to use OSBYTE 154, unless, as you say, your
program owns the hardware (for example, by performing all IRQ handling
yourself).



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
postmaster@...

This footnote also confirms that this email message has been checked
for all known viruses.

**********************************************************************
Sony Computer Entertainment Europe
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>