<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Thu, 24 Feb 2005 09:27:37 -0000
From   : "Jon Ripley" <jon@...>
Subject: Re: Mode 2 text

A.Weston wrote:
> Was there an issue regarding VDU22 and changing modes in procedures?
> IIRC you can't use MODE in BASIC II.

The MODE statement is available from BASIC I onwards. If you think about 
it, if MODE wan't in BASIC II, then only people with a BBC B+ or better 
would have been able to change mode! If there were any problems using 
VDU 22,mode then almost every BBC game would have suffered.

Just need to make sure that HIMEM is set to the right value for mode 2, 
otherwise you might risk corrupting the BASIC stack.
Best way to avoid this is to set MODE 2 at the start of the program and 
use VDU 22,mode in the rest of the program to switch screen mode.

Using MODE at the start of the program sets up everything correctly for 
BASIC - HIMEM, the stack and some other bits; BASIC then does VDU 
22,mode. VDU 22,mode sets up the VDU, system workspace and actually 
changes the screen mode.

HTH,
Jon Ripley
-- 
http://jonripley.com/
Free software for RISC OS, Unix, Acorn 8-Bit and Windows.
Home of BUG, the BBC User Group, and the JJR-PD Library. 
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>