BBC B+ thinks it's a BBC A?

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
Post Reply
LordVaderUK
Posts: 63
Joined: Thu Jan 31, 2019 12:26 am
Contact:

BBC B+ thinks it's a BBC A?

Post by LordVaderUK » Tue Apr 09, 2019 10:17 pm

I have a BBC B+ (I've double checked pictures of the motherboard, and it's definitely a B+) but it seems to think it's a Model A, in that there are no Modes 0 to 3, only 4 to 7.

Are there any simple checks I can in software / OS commands to get an idea of what's occurring? New to retro and asking lots of questions, sorry :roll:

User avatar
KenLowe
Posts: 582
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: BBC B+ thinks it's a BBC A?

Post by KenLowe » Tue Apr 09, 2019 10:22 pm

What does the startup message say? And what do you get in response to *FX0 ?

LordVaderUK
Posts: 63
Joined: Thu Jan 31, 2019 12:26 am
Contact:

Re: BBC B+ thinks it's a BBC A?

Post by LordVaderUK » Wed Apr 10, 2019 8:10 am

Acorn OS 64K

Acorn 1170 DFS

BASIC

A *FX0 returns OS 2.00...

User avatar
danielj
Posts: 7221
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: BBC B+ thinks it's a BBC A?

Post by danielj » Wed Apr 10, 2019 8:27 am

And what happens if you try modes 0-3?

User avatar
jgharston
Posts: 3508
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: BBC B+ thinks it's a BBC A?

Post by jgharston » Wed Apr 10, 2019 12:16 pm

and PRINT HIMEM

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

LordVaderUK
Posts: 63
Joined: Thu Jan 31, 2019 12:26 am
Contact:

Re: BBC B+ thinks it's a BBC A?

Post by LordVaderUK » Wed Apr 10, 2019 5:21 pm

danielj wrote:
Wed Apr 10, 2019 8:27 am
And what happens if you try modes 0-3?
It says “Bad mode”...

User avatar
AndyF
Posts: 1227
Joined: Sat Feb 23, 2008 10:16 pm
Location: Derby
Contact:

Re: BBC B+ thinks it's a BBC A?

Post by AndyF » Wed Apr 10, 2019 6:34 pm

As mentioned previously what happens (and what value is displayed) if you enter:

Code: Select all

PRINT HIMEM
I suppose you could try a few of the other ones but that one would likely be the one of most immediate interest.
Andy

* NEW * The Jetset Willy and Manic Miner community :)

Adventure games ported across to the BBC (in progress) as soon as I can find some time!

User avatar
DutchAcorn
Posts: 2092
Joined: Fri Mar 21, 2014 9:56 am
Location: Maarn, Netherlands
Contact:

Re: BBC B+ thinks it's a BBC A?

Post by DutchAcorn » Wed Apr 10, 2019 7:33 pm

LordVaderUK wrote:
Wed Apr 10, 2019 5:21 pm
danielj wrote:
Wed Apr 10, 2019 8:27 am
And what happens if you try modes 0-3?
It says “Bad mode”...
What about mode 128?
Paul

Image

LordVaderUK
Posts: 63
Joined: Thu Jan 31, 2019 12:26 am
Contact:

Re: BBC B+ thinks it's a BBC A?

Post by LordVaderUK » Wed Apr 10, 2019 8:33 pm

MODE 128 - changes mode. In fact any mode above 128 does something, changes screen mode.

PRINT HIMEM returns 31744 after a Ctrl-Break, and 32768 after entering MODE 128.

User avatar
KenLowe
Posts: 582
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: BBC B+ thinks it's a BBC A?

Post by KenLowe » Wed Apr 10, 2019 9:02 pm

What other ROMS do you have installed in your machine? *ROMS should give you a list.

LordVaderUK
Posts: 63
Joined: Thu Jan 31, 2019 12:26 am
Contact:

Re: BBC B+ thinks it's a BBC A?

Post by LordVaderUK » Wed Apr 10, 2019 9:51 pm

ROMs - all I have is DFS 2.10 and OS 2.00 installed.

User avatar
KenLowe
Posts: 582
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: BBC B+ thinks it's a BBC A?

Post by KenLowe » Thu Apr 11, 2019 12:09 am

Can you PRINT ~LOMEM and PRINT ~PAGE ?

If LOMEM > &4000 (and < &5800) then you will get the bad MODE error for modes 0..3, but we'd need to work out why LOMEM is being set so high.

If LOMEM is in the above range, then set it to &3000 (LOMEM=&3000) and try changing modes again.

Also, what happens if you try VDU22,0 ?
Last edited by KenLowe on Thu Apr 11, 2019 12:27 am, edited 2 times in total.

LordVaderUK
Posts: 63
Joined: Thu Jan 31, 2019 12:26 am
Contact:

Re: BBC B+ thinks it's a BBC A?

Post by LordVaderUK » Thu Apr 11, 2019 9:26 am

Ok here goes

PRINT ~LOMEM gives 1902
PRINT ~PAGE gives 1900

VDU 22,0 does indeed change screen mode - 80 columns so I'm guessing Mode 3?

User avatar
KenLowe
Posts: 582
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: BBC B+ thinks it's a BBC A?

Post by KenLowe » Thu Apr 11, 2019 9:36 am

That is weird. LOMEM at &1902 should allow all modes to be selected.

VDU22,0 is setting screen to mode 0. VDU22,3 would set it to mode 3. As I understand it, changing screen mode in this way is not really recommended, since it doesn't adjust the LOMEM value, whereas MODEx does change LOMEM. Someone with more knowledge may wish to correct me on this.

Edit: There's a little bit more info on VDU22 here: http://beebwiki.mdfs.net/VDU_22
Last edited by KenLowe on Thu Apr 11, 2019 9:40 am, edited 1 time in total.

LordVaderUK
Posts: 63
Joined: Thu Jan 31, 2019 12:26 am
Contact:

Re: BBC B+ thinks it's a BBC A?

Post by LordVaderUK » Thu Apr 11, 2019 10:48 am

Just to be a real pain, it seems to be intermittent. Right now, I can select all MODEs without any problem... 🤔 Clearly I need to do a bit more research and try and work out under what conditions this is occurring...

User avatar
dv8
Posts: 221
Joined: Mon Jun 22, 2009 9:07 pm
Contact:

Re: BBC B+ thinks it's a BBC A?

Post by dv8 » Thu Apr 11, 2019 11:11 am

The MODE command calls OSBYTE 133 (&85) to get the base address of screen memory for a given mode.
It reports a 'Bad mode' error if this address is below LOMEM.

It could be worth checking what values are returned from OSBYTE 133.
When it goes wrong again try the following command:

FOR X%=0 TO 7:A%=133:PRINT X%,~(USR&FFF4 AND&FFFF00)DIV&100:NEXT

It should return 3000 for modes 0-2, 4000 for mode 3, 5800 for modes 4-5, 6000 for mode 6 and 7C00 for mode 7.
If shadow screen memory is active (*SHADOW 0) it should return 8000 for all screen modes.

User avatar
AndyF
Posts: 1227
Joined: Sat Feb 23, 2008 10:16 pm
Location: Derby
Contact:

Re: BBC B+ thinks it's a BBC A?

Post by AndyF » Thu Apr 11, 2019 12:57 pm

Would one of the disc based memory testers be worth running perhaps ?

I'm thinking here the OS may not have a "16K" string in it to display that, despite it possibly thinking it, so it may not be able to say lower than 64K ?
Andy

* NEW * The Jetset Willy and Manic Miner community :)

Adventure games ported across to the BBC (in progress) as soon as I can find some time!

User avatar
jgharston
Posts: 3508
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: BBC B+ thinks it's a BBC A?

Post by jgharston » Thu Apr 11, 2019 2:47 pm

AndyF wrote:
Thu Apr 11, 2019 12:57 pm
Would one of the disc based memory testers be worth running perhaps ?

I'm thinking here the OS may not have a "16K" string in it to display that, despite it possibly thinking it, so it may not be able to say lower than 64K ?
The B+ MOS only has the "BBC Computer 64K" startup banner. If you have SRAM Utils or similar that can change the banner to, eg BBC Computer 96K. The MOS does do the same startup memory test as the B, but it never checks the result of the test in the way that the BBC B does to prevent large screen MODEs. So, HIMEM will always be &8000 downwards, so you would only normally get Bad MODE errors if the program has crept upwards into screen memory.

If you do PRINT ?&28E (OSBYTE 254) that will tell you the result of the memory test, but that test is never checked anywhere by the system.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

LordVaderUK
Posts: 63
Joined: Thu Jan 31, 2019 12:26 am
Contact:

Re: BBC B+ thinks it's a BBC A?

Post by LordVaderUK » Sat Apr 13, 2019 12:16 pm

So I am wondering then whether this issue (bad MODE) is in fact because the BBC is running low on memory, making certain modes unavailable.

The program I have written runs to about 900 lines of BASIC but I have no idea how much memory it is occupying once loaded.

I am assuming that it's some combination of LOMEM / HIMEM and that querying these values before and after a program is loaded will answer that question, am I right?

User avatar
KenLowe
Posts: 582
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: BBC B+ thinks it's a BBC A?

Post by KenLowe » Sat Apr 13, 2019 2:21 pm

Yes. Your program occupies the space between PAGE & LOMEM. The more lines of code you write, the bigger LOMEM will become. The memory space between LOMEM and &8000 is what is available for screen modes. So, as you increase your code, the less space you will have available for screen memory, and therefore you will start to lose the ability to switch into higher resolution modes.

Since you've actually got a BBC B+, you can get around this limitation by using the in built Shadow RAM. Shadow RAM was implemented in the BBC B+ specifically to get around the issue you've encountered. There's not a lot of program space available on a standard beeb if you want to use a high resolution screen mode.The Shadow RAM allows you to switch into any mode without reducing the memory space available for writing code (or conversely, will allow you to switch into any screen mode even if you've written a large program).

To switch into a shadow mode, enter MODE 128 (+ 0..7 for the screen mode you want to use). Alternatively, enter *SHADOW, and then MODE 0..7 for the screen mode you want to use

Post Reply