Ceefax Engineering Test Page - BeebEm 4.13 & B-em

discuss bbc micro and electron emulators (including mame) here!
User avatar
PitfallJones
Posts: 454
Joined: Fri Feb 22, 2008 3:44 pm
Contact:

Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by PitfallJones »

Hi,

I chanced upon this page:
bbctest_animated.gif
bbctest_animated.gif (39.9 KiB) Viewed 3974 times
Over at a terrific Ceefax site:
http://teletext.mb21.co.uk/gallery/test/

This page is pretty tricky as it combines all the teletext codes in a way to test if hardware work correctly - especially the conceal code and graphics hold etc.

It seems B-em displays this page perfectly - even ignoring the separate graphics command after a hold has been found whereas Beebem makes a bit of a mess of it.
beebem1.43.png
beebem1.43.png (7.7 KiB) Viewed 3974 times
Anyway I was determined to try it out for myself and had a go at recreating the page - then I discovered Alan Pemberton's early Teletext site that revealed the actual codes for the page! He as using a Texas Instruments Tifax rom that had shapes for characters 0-31.
ceefax1-engineering2.jpg
ceefax1-engineering2.jpg (39.47 KiB) Viewed 3974 times
http://www.pembers.freeserve.co.uk/Tele ... raphs.html

I also found a similar version at JGH's site:
http://mdfs.net/System/Teletext/

Here's my version of the codes:
eng_codes.png
eng_codes.png (5.58 KiB) Viewed 3974 times
And here's the binary file and a BBC test disk:
1,2,3 select different pictures and SPACEBAR swaps conceal (0x18) with an unused code 0x10. I wasn't sure how conceal is actually done on a real TV so I simulate it.

I'm guessing the box codes are how TVs do overlays like for subtitles so don't actually work on the BBC either.

Another strange thing I noticed is that TV's will actually duplicate a double height line to the next line so don't need information on the next line - the BBC Micro does however - so my code page is slightly different from Pembertons.
Also Teletext codes are actually only 7bit - so the Beeb manual is sort of misleading giving them codes >=0x80.
real_bbc.png
real_bbc.png (582.51 KiB) Viewed 3974 times
- PJ
Attachments
Eng_test.zip
(2.9 KiB) Downloaded 258 times
User avatar
richardtoohey
Posts: 4009
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by richardtoohey »

I *think* I've found the problem with Beebem, but I'm not sure I'm on the completely right track, so if anyone who knows about these things lets me know, that would be appreciated.

I'm working on the first set of issues - so the blocks on left line 2.

We can reduce this problem to ...

MODE 7
?&7C50=151
?&7C51=158
?&7C52=15
?&7C53=115
?&7C54=147

So Beebem correctly displays the held byte (115) instead of the 147 colour code at &7C54 BUT it incorrectly colours it yellow.

I think the colour code should be stored for use in the NEXT cell, it should not update the current cell as well - is that correct?

The current logic is something like:

If you get code 147 then current colour (INCLUDING current cell) is Yellow. Current cell is ASCII 32 (unless held character)

What it should be:

If you get code 147 then current cell is ASCII 32 (unless held character) and set the colour we'll use next time to be Yellow.

Then the next issue - sounds like you are saying that if you get a separated flag, you should ignore it while it held graphics (you should LITERALLY display the held graphic you had - including whether it was continuous/separate?)

So - if we get 153/154 we can toggle the separated flag BUT if we are rendering a held character, we should use the held character's separated flag?

Thanks.
User avatar
richardtoohey
Posts: 4009
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by richardtoohey »

Yes, I think I'm on the right track.

What Beebem is doing is taking the current control code and using it immediately, rather than applying it to the next byte/cell.

The current logic (by my reading, anyway) ...

If control code (129-159)
Make changes (e.g. red alpha, yellow graphic, release graphics whatever)
Emit character (possibly a held one) - with the settings JUST made

The logic should be /something/ more like ...

If control code (129-159)
If got held character, emit that (including continuous setting), else emit space
Make changes (e.g. red alpha, yellow graphic, release graphics whatever)
Else
Emit character

That's the theory ... going to be a bit more difficult (for me) to do but I'll give it a go ...
User avatar
PitfallJones
Posts: 454
Joined: Fri Feb 22, 2008 3:44 pm
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by PitfallJones »

Yes I agree with both your conclusions - the photo above is from a real BBC so that is what is actually happening (i.e. color changes occur on the next character) - which is also how B-em works so Tom's code does it correctly already.
- PJ
User avatar
richardtoohey
Posts: 4009
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by richardtoohey »

Thanks ... just had the cunning idea of digging out my A3010/RPC600 to see what they do in Mode 7 (I am working off your screenshots but good to have a real machine to poke) ... but the answer for both those machines is unfortunately nothing (too many years moldering in boxes.)

But in a dusty pile of old books found a BBC BASIC V book that explains a bit more about Mode 7 and a few light bulbs are going off generally.

I'll get there!
User avatar
Dreamland Fantasy
Posts: 562
Joined: Fri Dec 29, 2006 12:15 am
Location: Glasgow, UK
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by Dreamland Fantasy »

A while back I was hunting about for the Ceefax engineering test page, but I could only find the animated GIF of it. I wanted this so that I could test my Mode 7 to image converter was accurately converting Mode 7 screen dumps. I ended up making my own test page based on the animated GIF, but it had some parts missing as I couldn't figure out how to implement them (going from the discussion here, I guess this was due to limitations of BeebEm). Many thanks for the download! :D

Here's the test page converted with my Mode 7 converter (which looks as though it will need some tweaks):
eng_test.ttx.png
Kind regards,

Francis
Dreamland Fantasy Studios
http://www.dfstudios.co.uk
User avatar
jgharston
Posts: 4262
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by jgharston »

Dreamland Fantasy wrote:Here's the test page converted with my Mode 7 converter (which looks as though it will need some tweaks):
eng_test.ttx.png
Could also do with stretching the pixels horizontally. A MODE 7 screen is supposed to be close to 4 across and 3 high, that looks almost the other way around. A quick measure of my screen filled with block characters gives 24cm x 19cm which is about 3.8:3

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.32
(C) Copyright J.G.Harston 1989,2005-2020
>_
User avatar
Dreamland Fantasy
Posts: 562
Joined: Fri Dec 29, 2006 12:15 am
Location: Glasgow, UK
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by Dreamland Fantasy »

Yeah, that image uses 1:1 pixel scaling (480x500). My converter can also do 4:3 as well:
eng_test.ttx_safecolors.png
Today I just noticed that the asterisk wasn't being rendered properly, so I've fixed that.

I've been analysing the Ceefax test page and I've found it interesting that CHR$(127) displays as a white box, but the BBC manual states this should be a back space and delete.

Kind regards,

Francis
Dreamland Fantasy Studios
http://www.dfstudios.co.uk
User avatar
Dreamland Fantasy
Posts: 562
Joined: Fri Dec 29, 2006 12:15 am
Location: Glasgow, UK
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by Dreamland Fantasy »

On line '01' there doesn't appear to be any control codes to turn the colour red, just a bunch of CHR$(1)'s and CHR$(0)'s before getting to the '01' text. The only reason my converter shows it as red is because it reads each byte as BYTE AND &7F which drops the Alpha Red control code from 129 to 1. I'm confused as to why a BBC would show it as red. :?

It's 1:40am just now, maybe it's just that I'm tired I'm missing something obvious.

Kind regards,

Francis
Dreamland Fantasy Studios
http://www.dfstudios.co.uk
User avatar
jgharston
Posts: 4262
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by jgharston »

Dreamland Fantasy wrote:Yeah, that image uses 1:1 pixel scaling (480x500). My converter can also do 4:3 as well:
That looks much better!
Dreamland Fantasy wrote:I've been analysing the Ceefax test page and I've found it interesting that CHR$(127) displays as a white box, but the BBC manual states this should be a back space and delete.
. No, CHR$127 is delete, but ?(screenmemory)=127 is a solid block. ?(screenmemory)=13 is a "double height" control code, but CHR$13 is print carriage return. The bytes of data are not VDU control codes.

Teletext data bytes are 7-bit values. If you poke them into memory then values <&80 are identical to valies >&7F. When you put them into screen memory using the VDU drivers you usually use characters in the range 32 to 126 for printable characters and 128 to 159 for colour control codes, but those bytes in memory are identical to 0 to 31, it's just the VDU driver uses 0 to 31 for VDU control codes.

Teletext pages download off the air and stored into screen memory tend to be 7-bit data so, for example, "red text" will be a &01 byte, but that is identical to a &81 byte, printable with CHR$&81. To make it easier to manipulate the data programatically, programs such as my GetPages and others usually scan through the data and change all the 0-31 control codes to 128-159.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.32
(C) Copyright J.G.Harston 1989,2005-2020
>_
User avatar
Dreamland Fantasy
Posts: 562
Joined: Fri Dec 29, 2006 12:15 am
Location: Glasgow, UK
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by Dreamland Fantasy »

Of course! That makes so much sense now! =D>

That must also be why I originally used BYTE AND &7F (to convert to 7-bits). It's been years since I've looked at this section of the converter's code, and it's clear to me that I rushed it then and never made any comments as to why I did things the way I did. :roll:

Many thanks! :D

Kind regards,

Francis
Dreamland Fantasy Studios
http://www.dfstudios.co.uk
User avatar
Dreamland Fantasy
Posts: 562
Joined: Fri Dec 29, 2006 12:15 am
Location: Glasgow, UK
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by Dreamland Fantasy »

I found this today: http://www.etsi.org/deliver/etsi_i_ets/ ... 06e01p.pdf

Although it states enhanced teletext specification, it does also cover older specifications as well and seems to give quite good explanations as to what the control codes do. I like that it states what control codes are "set-at" and those that are "set-after" (my converter assumes everything is "set-at" at present). It even gives an example of how the hold and release graphics should work.

Kind regards,

Francis
Dreamland Fantasy Studios
http://www.dfstudios.co.uk
User avatar
Dreamland Fantasy
Posts: 562
Joined: Fri Dec 29, 2006 12:15 am
Location: Glasgow, UK
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by Dreamland Fantasy »

Here's the current output of my Mode 7 converter:
eng_test.ttx.png
It looks pretty good I think. I still need to tidy up the code though, but I'm happy I've got it working now with the test page. :D

Kind regards,

Francis
Dreamland Fantasy Studios
http://www.dfstudios.co.uk
User avatar
PitfallJones
Posts: 454
Joined: Fri Feb 22, 2008 3:44 pm
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by PitfallJones »

Looks like you've decoded it spot on now - I was going to say the B-em source would be a good guide.

And thanks for that document - it explains the functionality completely - interesting about the reference to alpha black as well
( which the BBC doesn't support as I guess it's just level #1 )

I hadn't read a description for the box command before, either.

- PJ
User avatar
Dreamland Fantasy
Posts: 562
Joined: Fri Dec 29, 2006 12:15 am
Location: Glasgow, UK
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by Dreamland Fantasy »

Thanks PJ! I've still got some work to do yet like implementing the flashing colours, but the hardest part should be behind me now.

I did try downloading B-Em, but it just gets blocked on my system as a malware threat. :(

I found that document very handy, I'm glad you think so too. It does have some nice tips on how to decode the teletext data such as you only need to check if bit 6 is high for graphics characters. Now I am just using the equivalent of BYTE AND &20 to check for graphics characters whereas before I was checking for a range of values.

Kind regards,

Francis
Dreamland Fantasy Studios
http://www.dfstudios.co.uk
galax
Posts: 103
Joined: Mon Jul 21, 2014 4:58 pm
Contact:

.

Post by galax »

.
Last edited by galax on Wed Mar 16, 2016 3:45 pm, edited 3 times in total.
User avatar
Dreamland Fantasy
Posts: 562
Joined: Fri Dec 29, 2006 12:15 am
Location: Glasgow, UK
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by Dreamland Fantasy »

No problem galax. Getting the "Set-At" and "Set-After" sorted in my converter fixed the majority of errors I had. The other problem I had was just getting the graphics hold function working correctly.

I like your webpage. A few of the characters don't seem to be 100% accurate though, in my opinion, when compared with a BBC Micro, but it's pretty cool seeing teletext style on a webpage! (^_^)

Kind regards,

Francis
Dreamland Fantasy Studios
http://www.dfstudios.co.uk
User avatar
jgharston
Posts: 4262
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by jgharston »

galax wrote:I used the same Engineering testcard to verify that my Teletext rendered as HTML (complete with Flash and Reveal) was working properly
I always felt it was really neat that the list of colour names fitted exactly onto a single line. :)

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.32
(C) Copyright J.G.Harston 1989,2005-2020
>_
User avatar
Dreamland Fantasy
Posts: 562
Joined: Fri Dec 29, 2006 12:15 am
Location: Glasgow, UK
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by Dreamland Fantasy »

jgharston wrote:I always felt it was really neat that the list of colour names fitted exactly onto a single line. :)
I was just thinking that yesterday when I was looking at the testcard again. lol! (^_^)

Kind regards,

Francis
Dreamland Fantasy Studios
http://www.dfstudios.co.uk
galax
Posts: 103
Joined: Mon Jul 21, 2014 4:58 pm
Contact:

.

Post by galax »

.
Last edited by galax on Wed Mar 16, 2016 3:44 pm, edited 2 times in total.
User avatar
Dreamland Fantasy
Posts: 562
Joined: Fri Dec 29, 2006 12:15 am
Location: Glasgow, UK
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by Dreamland Fantasy »

galax wrote:I noticed that a few of your characters have a pixel or two out of place as well! These all have small errors: 3 z M N Q 1/4 3/4 leftarrow uparrow rightarrow
Well spotted! Thanks for pointing those out.

I did notice that the rendering of * was incorrect on my original conversions which I've since fixed. I intended going back and checking the other characters at a later stage, but you have beat me to it! lol! :D

Kind regards,

Francis
Dreamland Fantasy Studios
http://www.dfstudios.co.uk
User avatar
Dreamland Fantasy
Posts: 562
Joined: Fri Dec 29, 2006 12:15 am
Location: Glasgow, UK
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by Dreamland Fantasy »

galax wrote:I've applied the corrections to my font, fixing 1 3 z M N Q R % @ & , : * - = leftarrow rightarrow uparrow emdash

The testcard now looks like the attached, might still an error or two in there somewhere, but it's pretty close now...
It looks as though you still need to fix the R, 4, 1/4 and 3/4.

Kind regards,

Francis
Dreamland Fantasy Studios
http://www.dfstudios.co.uk
User avatar
Dreamland Fantasy
Posts: 562
Joined: Fri Dec 29, 2006 12:15 am
Location: Glasgow, UK
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by Dreamland Fantasy »

I think that should be mine fixed now:
eng_test.ttx.png
Please let me know if you spot any more errors.

Kind regards,

Francis
Dreamland Fantasy Studios
http://www.dfstudios.co.uk
galax
Posts: 103
Joined: Mon Jul 21, 2014 4:58 pm
Contact:

.

Post by galax »

.
Last edited by galax on Wed Mar 16, 2016 3:43 pm, edited 2 times in total.
User avatar
Dreamland Fantasy
Posts: 562
Joined: Fri Dec 29, 2006 12:15 am
Location: Glasgow, UK
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by Dreamland Fantasy »

galax wrote:Thanks I'll fix those last few. Your 1/4 and 3/4 still aren't quite right- the hole in the middle of the 4 shouldn't be square. It never ends!
Thanks for letting me know. I'll fix those later since it's 4am here and I'm heading off to bed now. lol!

Kind regards,

Francis
Dreamland Fantasy Studios
http://www.dfstudios.co.uk
User avatar
BigEd
Posts: 3751
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by BigEd »

That last line with Flash Box Steady Gone - I would expect Steady should not be flashing. See for example
https://youtu.be/b1ZKzh7LgF4?t=1m42s

Cheers
Ed
User avatar
Dreamland Fantasy
Posts: 562
Joined: Fri Dec 29, 2006 12:15 am
Location: Glasgow, UK
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by Dreamland Fantasy »

Animated version of the test card, with corrected font:
eng_test.ttx.gif
BigEd wrote:That last line with Flash Box Steady Gone - I would expect Steady should not be flashing. See for example
https://youtu.be/b1ZKzh7LgF4?t=1m42s
Yes, that is what I would expect too.

Kind regards,

Francis
Dreamland Fantasy Studios
http://www.dfstudios.co.uk
galax
Posts: 103
Joined: Mon Jul 21, 2014 4:58 pm
Contact:

.

Post by galax »

.
Last edited by galax on Wed Mar 16, 2016 3:51 pm, edited 2 times in total.
User avatar
BigEd
Posts: 3751
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by BigEd »

I suppose you've already found this gallery
http://teletext.mb21.co.uk/gallery/test/
?
User avatar
Dreamland Fantasy
Posts: 562
Joined: Fri Dec 29, 2006 12:15 am
Location: Glasgow, UK
Contact:

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Post by Dreamland Fantasy »

jgharston wrote:A MODE 7 screen is supposed to be close to 4 across and 3 high, that looks almost the other way around. A quick measure of my screen filled with block characters gives 24cm x 19cm which is about 3.8:3
I've spent some time today refining the output of my Mode 7 converter. On the system I'm looking at here, the aspect ratio appears to be more 4:3.5, so e.g. if we keep the 500 vertical resolution the horizontal resolution will become approx. 572.

Kind regards,

Francis
Dreamland Fantasy Studios
http://www.dfstudios.co.uk
Post Reply

Return to “8-bit acorn emulators”