Emulating an NTSC BBC B

discuss bbc micro and electron emulators (including mame) here!
Post Reply
electron_plus40
Posts: 21
Joined: Wed Jul 05, 2023 12:07 am
Contact:

Emulating an NTSC BBC B

Post by electron_plus40 »

I've recently restored my US BBC B back to it's full original configuration. It spent the last ~20 years pretending to be a weird mix of UK and US systems (PAL display, but, 120v PSU), mostly by means of having it's US OS ROM replaced with a bog standard OS 1.2 ROM, and DNFS pulled and replaced with LFS. It did still have View installed though.

Now that it is back together, I wanted to start playing with software to see what did and didn't work, since it's now producing NTSC output. My SD card is fairly well attached to my Master 128 and I haven't built up the one for the B yet, so rather than wait to see what happens when I get to that, I decided to try and emulate a US BBC B today, instead.

With the right US ROMs, I was able to get BeebEm 4.19 to emulate a US BBC B, including "NTSC" (reduced screen) output.

OS -> BBC OS 1.20 (US, A1.0) <- I should rename this rom image
15 -> BBC BASIC 3
14 -> DNFS 1.2
BeebEm ROM Config
BeebEm ROM Config
MODE 2 with HIMEM=&4000 (vs &3000 for PAL)
MODE 2 with HIMEM at &amp;4000
MODE 2 with HIMEM at &4000
MODE 1 with 25 lines
MODE 1 with 25 lines
MODE 1 with 25 lines
REPTON 1 - notice the bottom is cut off, thanks to NTSC. But I must admit, I was expecting the TOP to be cut off, not the bottom.
REPTON 1
REPTON 1
Poor Caesar!
Caesar The Cat
Caesar The Cat
FireTrack's loading screens got a little confused:
Fire Track Loading
Fire Track Loading
Fire Track Loading 2
Fire Track Loading 2
But the game itself seemed fine, maybe because it's already not using the full screen in PAL?
Fire Track
Fire Track
electron_plus40
Posts: 21
Joined: Wed Jul 05, 2023 12:07 am
Contact:

Re: Emulating an NTSC BBC B

Post by electron_plus40 »

I've attached the 3 ROMs I used for anyone else who wants to play with this without having to go dig them up.
Attachments
DNFS-1.2-201666.rom
DNFS 1.2 ROM
(16 KiB) Downloaded 8 times
BBC OS 1.20 (US).rom
BBC OS A1.0 (US OS 1.2) ROM
(16 KiB) Downloaded 7 times
BASIC300.rom
BASIC 3 ROM
(16 KiB) Downloaded 9 times
User avatar
BeebMaster
Posts: 7379
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Emulating an NTSC BBC B

Post by BeebMaster »

I haven't tried using the US OS in a UK Beeb, but I expect the effect would be the same as using the US OS in a US Beeb; 10 years ago I did quite a bit of experimentation with the US OS in a US Beeb (anything with "US OS" in the set title):

https://www.beebmaster.co.uk/BM10/USBeeb.html

Be interesting to do some of it again now that I have better screen capture tools than I did then.
Image
gfoot
Posts: 987
Joined: Tue Apr 14, 2020 9:05 pm
Contact:

Re: Emulating an NTSC BBC B

Post by gfoot »

I would imagine games that make more advanced use of the 6845, like Firetrack with its smooth vertical scrolling, would essentially undo all the NTSCness. It depends how thoroughly they overwrite its registers though!

I experimented with setting the 6845 to output a 60Hz signal to see how a Cub monitor would respond, I think it wasn't OK but the image did not vertically fill the screen, the monitor wasn't smart enough to stretch it.

It's likely that due to its restricted screen width Repton is just setting the same &6000 base address that the US Beeb would already be using, so the top looks fine; but it is not updating the registers to display all 32 lines that it is expecting, so the screen appears off-centre vertically. You could probably patch it to add an offset to keep things centred.

In general though I would expect most games would have needed rereleasing for the US market.
electron_plus40
Posts: 21
Joined: Wed Jul 05, 2023 12:07 am
Contact:

Re: Emulating an NTSC BBC B

Post by electron_plus40 »

gfoot wrote: Thu Sep 14, 2023 10:55 pmI experimented with setting the 6845 to output a 60Hz signal to see how a Cub monitor would respond
I'd like to know how you did this!
gfoot
Posts: 987
Joined: Tue Apr 14, 2020 9:05 pm
Contact:

Re: Emulating an NTSC BBC B

Post by gfoot »

electron_plus40 wrote: Thu Sep 14, 2023 11:50 pm
gfoot wrote: Thu Sep 14, 2023 10:55 pmI experimented with setting the 6845 to output a 60Hz signal to see how a Cub monitor would respond
I'd like to know how you did this!
A default scanline takes 64us, and there are 312.5 of them in a 50Hz field (20ms). That's 39x8 plus half for interlacing. To achieve this in modes 0,1,2,4,5 the 6845 is programmed for 8 scanlines per row, 32 visible rows (register 6), and 39 total rows (register 4, with 1 subtracted) with no extra scanlines (register 5).

For 60Hz, assuming we don't change the scanline duration (I think it is meant to be slightly less, technically, but we can't do that without changing the pixel clock) we need 260.5 scanlines per field. That's 32 character rows plus 4 extra scanlines plus half for interlacing - so we set the vertical total register 4 to 32-1=31, and add 4 extra scanlines using the "vertical adjust" register 5. Also set the number of visible rows to 25, and change the vsync position (register 7) to something that works well inside the range 25-32 - it will offset the display up and down like *TV does.

E.g.

Code: Select all

VDU 23;4,31,0;0;0;23;5,4,0;0;0;23;6,25,0;0;0;23;7,29,0;0;0;
Do them all in one go, and be ready to hit Break if it doesn't work as your monitor might not like receiving out-of-spec frequencies for long periods.

You can also use 262.5 scanlines per field, matching NTSC, but the frame rate will drop a bit lower due to our scanlines still being 64us long. This will just add an extra two scanlines to the frame, so you can add them to the vertical adjust, i.e. set register 5 to 6 instead of 4.

Either of these should output approximately 60Hz and its probably as close as you can get to standard US frequencies without changing the 16MHz crystal.
Post Reply

Return to “8-bit acorn emulators”