MODEs above 11 - BBC Basic for SDL

Discussions about the BBC BASIC language, with particular reference to BB4W and BBCSDL
spider99
Posts: 2
Joined: Sat 31 Jan 2026, 15:36

MODEs above 11 - BBC Basic for SDL

Post by spider99 »

Why is it that when I try to use a MODE above 11 in BBC Basic for SDL (Windows 10), the output window appears briefly and then disappears? This still happens if I make the program wait for input.

So far just a 2 or 3 line program. MODE xx, PRINT "something", INPUT variable.
where xx is > 11.

No problems when xx is < 12.

Many thanks...
Richard Russell
Posts: 582
Joined: Tue 18 Jun 2024, 09:32

Re: MODEs above 11 - BBC Basic for SDL

Post by Richard Russell »

spider99 wrote: Sat 31 Jan 2026, 15:42 Why is it that when I try to use a MODE above 11 in BBC Basic for SDL (Windows 10), the output window appears briefly and then disappears?
Most likely because the MODE you selected has larger dimensions than your current desktop (taking into account High DPI Scaling, which is on by default on most OSes). That may be exacerbated by the fact that only MODEs 0 to 9 share the same dimensions with Acorn machines, so check the relevant documentation to ensure the MODE you selected has the dimensions you wanted (if necessary use VDU 23,22... to select a custom mode).

For example the laptop I am using to type this, despite having quite a high native resolution, is only 1280 x 720 after High DPI Scaling (it's 13 inches diagonal) and if I try to select a MODE bigger than that it will behave as you describe. There is some information in the manual on running BBC BASIC with High DPI Scaling turned off, but it can cause compatibility issues with 'legacy' (e.g. BBC Micro) programs.
spider99
Posts: 2
Joined: Sat 31 Jan 2026, 15:36

Re: MODEs above 11 - BBC Basic for SDL

Post by spider99 »

Many thanks.
After posting I played around with the VDU command and noticed that the same thing happened when gradually increasing the window size and eventually filling the physical screen - and came to the conclusion described in your reply.
User avatar
hellomike
Posts: 195
Joined: Sat 09 Jun 2018, 09:47
Location: Amsterdam

Re: MODEs above 11 - BBC Basic for SDL

Post by hellomike »

In a program I used this construct to prevent the user to scale a window larger than possible. I.e. larger than

Code: Select all

VDU 23, 22, Wwnd%/2; Hwnd%/2; 8, 16, 16, 128
allows.

Wwnd% and Hwnd% are calculated just prior to the VDU statement using the current value in the Scale% variable.

Before this calculation and the VDU statement, I added:

Code: Select all

ON ERROR LOCAL Scale%-=1
Hope this helps.

Mike
Richard Russell
Posts: 582
Joined: Tue 18 Jun 2024, 09:32

Re: MODEs above 11 - BBC Basic for SDL

Post by Richard Russell »

hellomike wrote: Tue 03 Feb 2026, 20:14 In a program I used this construct to prevent the user to scale a window larger than possible...
The help manual lists the relevant API functions (for both BB4W and BBCSDL) for discovering the size of the 'desktop', which gives you the maximum safe dimensions of the BBC BASIC window to ensure that it can be successfully created.

In BBCSDL you also have the option of selecting a window size which is virtually guaranteed to fit (such as 800 x 600) with automatic scaling enabled as described in the help manual here. Then the user can resize or maximize the window and the content will be scaled/centered appropriately.

Incidentally your use of Hwnd% to mean the window height could easily be confused with the use of @hwnd% to mean the window handle so personally I would want to choose a different variable name.