Beebem teletext hold char (158) issue

want to talk about MESS/model b/beebem/b-em/electrem/elkulator? do it here!
User avatar
spark001uk
Posts: 18
Joined: Thu Oct 12, 2017 11:44 am

Beebem teletext hold char (158) issue

Postby spark001uk » Fri Nov 24, 2017 2:44 pm

Been having a problem reproducing some teletext images from within beebem; I'm running into the issue with the "hold graphics" (158 / 0x9E) control code. When I change colour, it's repeating the correct character but in the new colour rather than the old one, it needs to apply the colour to the next byte, not the current one. I understand this is a known issue with beebem, but wanted to know has anyone released a "fixed" version yet?
I did find this github entry whilst looking around, it mentions a fix at the top of the page, and there's something about it in the code around the 720ish mark. But what do I do with this code? Is it a fix to the hold graphics problem? Would it have to be compiled back into a new beebem package or something? Not sure myself, all I know is it looks like C++.

guesser
Posts: 143
Joined: Mon Jun 26, 2006 9:21 pm

Re: Beebem teletext hold char (158) issue

Postby guesser » Fri Nov 24, 2017 4:31 pm

Indeed colour codes should be Set-After. While someone's at it they should probably "fix" the bug that it doesn't correctly emulate the SAA5050's buggy hold mosaics, as noticed at the beginning of the year by kieranhj (though I've since discovered that it's been "known" for years just not widely)

guesser
Posts: 143
Joined: Mon Jun 26, 2006 9:21 pm

Re: Beebem teletext hold char (158) issue

Postby guesser » Fri Nov 24, 2017 4:45 pm

oh, looking at the code, the most recent commit is a fix for the set-after colour issue!

chrisn
Posts: 311
Joined: Sat Apr 19, 2014 11:31 am
Location: UK

Re: Beebem teletext hold char (158) issue

Postby chrisn » Fri Nov 24, 2017 4:53 pm

I believe this issue is fixed in the latest code in GitHub, but we haven't released a new binary with this fix included, so you'll still see the issue if you're using BeebEm 4.14 or earlier.

I should really get on releasing the new version soon... :-

guesser
Posts: 143
Joined: Mon Jun 26, 2006 9:21 pm

Re: Beebem teletext hold char (158) issue

Postby guesser » Fri Nov 24, 2017 5:02 pm

I'm going to have a go at building from source and playing around in the teletext code a bit IF VS BUILD TOOLS EVER FINISHES DOWNLOADING :evil:

Maybe I should start porting the project to mingw and see which is completed first :lol:

guesser
Posts: 143
Joined: Mon Jun 26, 2006 9:21 pm

Re: Beebem teletext hold char (158) issue

Postby guesser » Fri Nov 24, 2017 8:41 pm

hurrah! It took much gnashing of teeth and downloading the wrong things incredibly slowly off the Microsoft servers but I got there in the end.
itverks.png

In case anyone's mad enough to fancy doing the same here's the links to the tools I ended up installing for it to work:
http://landinghub.visualstudio.com/visu ... uild-tools and https://www.microsoft.com/en-gb/downloa ... px?id=6812

Now to start fiddling with the code to see if I can break it :)

User avatar
Matt Godbolt
Posts: 163
Joined: Mon Jul 31, 2006 10:02 am
Location: Chicago
Contact:

Re: Beebem teletext hold char (158) issue

Postby Matt Godbolt » Fri Nov 24, 2017 8:52 pm

Glad to report this works OK in jsbeeb too (As best I can tell): https://bbc.godbolt.org/?autorun&loadBa ... tfile1.txt

User avatar
Pernod
Posts: 1001
Joined: Fri Jun 08, 2012 10:01 pm
Location: Croydon, UK

Re: Beebem teletext hold char (158) issue

Postby Pernod » Fri Nov 24, 2017 9:04 pm

... and MAME is good too!
0000.png
- Nigel

BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.

guesser
Posts: 143
Joined: Mon Jun 26, 2006 9:21 pm

Re: Beebem teletext hold char (158) issue

Postby guesser » Fri Nov 24, 2017 9:15 pm

It suffers the same issue as BeebEm though of not emulating the SAA5050's bug :)

I'll have to create a test page for someone who's got their beeb set up to properly nail down exactly what the SAA5050 does.

guesser
Posts: 143
Joined: Mon Jun 26, 2006 9:21 pm

Re: Beebem teletext hold char (158) issue

Postby guesser » Fri Nov 24, 2017 9:17 pm

MAME might get the bug part right as I seem to recall the guy I was talking to on twitter mentioning MAME.
Try 145 255 158 146 147 148

User avatar
Pernod
Posts: 1001
Joined: Fri Jun 08, 2012 10:01 pm
Location: Croydon, UK

Re: Beebem teletext hold char (158) issue

Postby Pernod » Fri Nov 24, 2017 9:23 pm

guesser wrote:MAME might get the bug part right as I seem to recall the guy I was talking to on twitter mentioning MAME.
Try 145 255 158 146 147 148

Who were you talking to on twitter?
0001.png

Edit: Both match real Beeb.
- Nigel

BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.

guesser
Posts: 143
Joined: Mon Jun 26, 2006 9:21 pm

Re: Beebem teletext hold char (158) issue

Postby guesser » Fri Nov 24, 2017 9:46 pm

Pernod wrote:
guesser wrote:MAME might get the bug part right as I seem to recall the guy I was talking to on twitter mentioning MAME.
Try 145 255 158 146 147 148

Who were you talking to on twitter?
0001.png
Edit: Both match real Beeb.

Oh, hrm, I must have got the sequence wrong then. Working from memory.
It was someone who's written a SAA5050 emulation who went deep on getting the character rounding and everything perfect, I asked him about the hold thing and he said he discovered it years ago.

I'm just digging up old posts so I can provide a proper test case.

guesser
Posts: 143
Joined: Mon Jun 26, 2006 9:21 pm

Re: Beebem teletext hold char (158) issue

Postby guesser » Fri Nov 24, 2017 9:49 pm

Try this one:
145 255 157 158 156 157 156 157

guesser
Posts: 143
Joined: Mon Jun 26, 2006 9:21 pm

Re: Beebem teletext hold char (158) issue

Postby guesser » Fri Nov 24, 2017 9:57 pm

Ah, found the twitter message again, it's not his code in MAME, he was just mentioning how long it took for font smoothing to be added.

User avatar
Pernod
Posts: 1001
Joined: Fri Jun 08, 2012 10:01 pm
Location: Croydon, UK

Re: Beebem teletext hold char (158) issue

Postby Pernod » Fri Nov 24, 2017 10:17 pm

guesser wrote:Ah, found the twitter message again, it's not his code in MAME, he was just mentioning how long it took for font smoothing to be added.

Makes sense as it was me that added it a few years ago. It is heavily 'influenced' on b-em and jsbeeb so expect it to match those.

guesser wrote:Try this one:
145 255 157 158 156 157 156 157

I see a difference with this, emulation produces a solid block but real hardware has two gaps in it.
20171124_221114.jpg
- Nigel

BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.

guesser
Posts: 143
Joined: Mon Jun 26, 2006 9:21 pm

Re: Beebem teletext hold char (158) issue

Postby guesser » Fri Nov 24, 2017 10:25 pm

Pernod wrote:I see a difference with this, emulation produces a solid block but real hardware has two gaps in it.
20171124_221114.jpg


Yup, that's the bug. The question now is what exactly causes it to occur. I had obviously misremembered from Feb as I thought it was a case of the 5050 not committing a character until after the first hold code, but clearly it's not. Actually something to do with the black background code (at least in this case)

what if instead a new background (156) at the end you but a sequence of mosaic colour codes. Does it display the held char correctly or has it been reset?

We could really do with a screen containing an exhaustive combination of control codes and hold mosaics.

guesser
Posts: 143
Joined: Mon Jun 26, 2006 9:21 pm

Re: Beebem teletext hold char (158) issue

Postby guesser » Fri Nov 24, 2017 10:26 pm

Pernod wrote:I see a difference with this, emulation produces a solid block but real hardware has two gaps in it.
20171124_221114.jpg


Yup, that's the bug. The question now is what exactly causes it to occur. I had obviously misremembered from Feb as I thought it was a case of the 5050 not committing a character until after the first hold code, but clearly it's not. Actually something to do with the black background code (at least in this case)

what if instead a new background (157) at the end you but a sequence of mosaic colour codes. Does it display the held char correctly or has it been reset?

We could really do with a screen containing an exhaustive combination of control codes and hold mosaics.[/quote]
Last edited by guesser on Fri Nov 24, 2017 10:26 pm, edited 1 time in total.

User avatar
hoglet
Posts: 6622
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Beebem teletext hold char (158) issue

Postby hoglet » Fri Nov 24, 2017 10:26 pm

Nigel,

Have you tried running the Ceefax Test card program, from this thread?
http://www.stardot.org.uk/forums/viewto ... f=4&t=4686

This was invaluable for improving the SAA5050 implementation in Beeb FPGA.

Dave

guesser
Posts: 143
Joined: Mon Jun 26, 2006 9:21 pm

Re: Beebem teletext hold char (158) issue

Postby guesser » Fri Nov 24, 2017 10:30 pm

hoglet wrote:Nigel,

Have you tried running the Ceefax Test card program, from this thread?
http://www.stardot.org.uk/forums/viewto ... f=4&t=4686

This was invaluable for improving the SAA5050 implementation in Beeb FPGA.

Dave


This particular bug doesn't show up from that test card because there is no hold mosaics in force in the areas with background colour. It was only because Kieran's image conversion algorithm kept generating those crazy sequences of new background/black background that you'd never do on purpose that we noticed it :)

EDIT: the now fixed one from the original post would of course.
Last edited by guesser on Fri Nov 24, 2017 10:31 pm, edited 1 time in total.

User avatar
Pernod
Posts: 1001
Joined: Fri Jun 08, 2012 10:01 pm
Location: Croydon, UK

Re: Beebem teletext hold char (158) issue

Postby Pernod » Fri Nov 24, 2017 10:30 pm

hoglet wrote:Have you tried running the Ceefax Test card program, from this thread?
http://www.stardot.org.uk/forums/viewto ... f=4&t=4686

This was invaluable for improving the SAA5050 implementation in Beeb FPGA.

Yeah, that's emulated perfectly as far as I know. This bug is not apparent on the test card.
- Nigel

BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.

tom_seddon
Posts: 84
Joined: Mon Aug 29, 2005 11:42 pm
Contact:

Re: Beebem teletext hold char (158) issue

Postby tom_seddon » Sun Nov 26, 2017 4:50 pm

After some experimentation it looks like control codes reset the held mosaic char when hold mosaics are off. Demo attached - load disc, CHAIN"HOLD2". It just shows VDU 145,97,n,158, where n is each control char in turn. (8 control chars per page. Press a key to get to the next page.) When n is 158, you get 3 copies of mosaic 'a'; in other cases, you get 1.

(You can see that 157 resets it too by doing something like VDU 147,97,157,158,156,97.)

I've sent a pull request for jsbeeb that I think fixes it: https://github.com/mattgodbolt/jsbeeb/pull/157 - with this minor change, running HOLD2 gives you the same thing on jsbeeb as you get on my Master 128. 145 255 157 158 156 157 156 157 looks correct too.

--Tom
Attachments
mode7.zip
(444 Bytes) Downloaded 9 times

guesser
Posts: 143
Joined: Mon Jun 26, 2006 9:21 pm

Re: Beebem teletext hold char (158) issue

Postby guesser » Sun Nov 26, 2017 5:51 pm

Excellent. I'll have a crack at a BeebEm patch.
Incidentally I've found another bug in BeebEm which is that an alphanumerics code isn't clearing the held character.

guesser
Posts: 143
Joined: Mon Jun 26, 2006 9:21 pm

Re: Beebem teletext hold char (158) issue

Postby guesser » Sun Nov 26, 2017 6:34 pm

I've had a go at fixing BeebEm and fixed a couple of other issues while I was at it such as rendering the held character with the correct separated mosaics mode.

Here's the patch: <removed>

Edit: still no quite right, but getting closer
beebem.png
Last edited by guesser on Sun Nov 26, 2017 11:51 pm, edited 1 time in total.

guesser
Posts: 143
Joined: Mon Jun 26, 2006 9:21 pm

Re: Beebem teletext hold char (158) issue

Postby guesser » Sun Nov 26, 2017 10:03 pm

The test card I'm using is here: http://temp.zxnet.co.uk/teletext.ssd
Could someone upload a photo of that displaying on a real beeb?

tom_seddon
Posts: 84
Joined: Mon Aug 29, 2005 11:42 pm
Contact:

Re: Beebem teletext hold char (158) issue

Postby tom_seddon » Sun Nov 26, 2017 10:32 pm

Image attached, for whatever it's worth... my phone's camera is awful at taking CRT shots (and having me as the operator doesn't help). The four separated graphics bars at the top right are, from left to right, green, magenta, red and blue, but I think everything else looks roughly right.

The text "* Box" at the bottom is flashing.

--Tom
Attachments
IMG_20171126_222602387_HDR.jpg

guesser
Posts: 143
Joined: Mon Jun 26, 2006 9:21 pm

Re: Beebem teletext hold char (158) issue

Postby guesser » Sun Nov 26, 2017 10:44 pm

tom_seddon wrote:Image attached, for whatever it's worth... my phone's camera is awful at taking CRT shots (and having me as the operator doesn't help). The four separated graphics bars at the top right are, from left to right, green, magenta, red and blue, but I think everything else looks roughly right.

The text "* Box" at the bottom is flashing.


Yup that's great thanks, I can see all the bits I need to clearly enough.
My current iteration of the code is closer to that but still not quite there. I'm almost tempted to just rip out the whole character row decoding loop and port my own teletext renderer code over from javascript cause I know my algorithm works :)

beebem2.png

Just the cyan blocks at the top left to sort out now, and fix conceal which I seem to have broken

guesser
Posts: 143
Joined: Mon Jun 26, 2006 9:21 pm

Re: Beebem teletext hold char (158) issue

Postby guesser » Sun Nov 26, 2017 11:58 pm

Think I might be there unless anyone can come up with any other tests.

Here's the testcard:
beebem3.png


A patch against the current github master: http://temp.zxnet.co.uk/0001-mode7-fixes.patch

User avatar
leenew
Posts: 3402
Joined: Wed Jul 04, 2012 3:27 pm
Location: Doncaster, Yorkshire

Re: Beebem teletext hold char (158) issue

Postby leenew » Mon Nov 27, 2017 12:52 am

That's great! When are we likely to see this incorporated into an official BeebEm release?
Lee.

chrisn
Posts: 311
Joined: Sat Apr 19, 2014 11:31 am
Location: UK

Re: Beebem teletext hold char (158) issue

Postby chrisn » Mon Nov 27, 2017 4:54 pm

leenew wrote:That's great! When are we likely to see this incorporated into an official BeebEm release?


Yes, great work indeed :D I'll do some tests and will be happy to merge the patch.

Over the weekend I merged the fixes that JGH submitted, while keeping the emulator filing system traps code (which needs more work to complete) on a branch.

This means that the next major BeebEm release is about ready to go. I'll prepare binaries and contact Mike about hosting them on his website.

User avatar
spark001uk
Posts: 18
Joined: Thu Oct 12, 2017 11:44 am

Re: Beebem teletext hold char (158) issue

Postby spark001uk » Tue Nov 28, 2017 1:35 am

Excellent work guys. Thanks very much for getting to the bottom of it, I know it's been a problem that's been around for a while now!


Return to “emulators”

Who is online

Users browsing this forum: No registered users and 2 guests