BBC Basic for SDL 2.0 - VDU 23 command not working

discuss bbc micro and electron emulators (including mame) here!
Post Reply
Tzap_Micro
Posts: 6
Joined: Wed Mar 24, 2021 6:30 pm
Contact:

BBC Basic for SDL 2.0 - VDU 23 command not working

Post by Tzap_Micro »

Hi all. I got my BBC Micro from 1983 working and managed to access a disk containing some of my old Basic games I created. They work fine in BeebEm. Extracted as text files and opened in BBC Basic for SDL 2.0. They appear to run ok except for any user defined characters using VDU 23. See attached screen shot. First is what the game should look like and second is in BBC Basic for SDL. Reason I'd like it working is that I want to create standalone .exe. Thanks!
Attachments
s1.JPG
s2.JPG
User avatar
jgharston
Posts: 5321
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: BBC Basic for SDL 2.0 - VDU 23 command not working

Post by jgharston »

VDU 23 works fine for me. What's more likely is that the program is broken, defining, eg CHR$224, and then printing CHR$128 and somehow expecting them to be the same.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.45
(C) Copyright J.G.Harston 1989,2005-2024
>_
Tzap_Micro
Posts: 6
Joined: Wed Mar 24, 2021 6:30 pm
Contact:

Re: BBC Basic for SDL 2.0 - VDU 23 command not working

Post by Tzap_Micro »

Thanks for quick reply! First screen is from beebem so I think program is ok?
User avatar
sweh
Posts: 3314
Joined: Sat Mar 10, 2012 12:05 pm
Location: 07410 New Jersey
Contact:

Re: BBC Basic for SDL 2.0 - VDU 23 command not working

Post by sweh »

One of the things the Beeb did is what JGH alludes to; unless you "explode" the user defined characters then a redefined character shows in multiple places in the character map.

(See OSBYTE 20 for details of how this works)

eg

Code: Select all

MODE 2
VDU 23,224,255,255,255,255,255,255,255,255
VDU 224
This will, as expected, draw a solid box.

BUT "VDU 128" will also draw a solid box.

This started to hit people on a Master 128 'cos there the character set is "exploded" by default; now if you do VDU 224 you get the expected block, but VDU 128 gives an "A".

It's very likely you're hittting a similar issue in your code.
Rgds
Stephen
User avatar
dv8
Posts: 397
Joined: Mon Jun 22, 2009 10:07 pm
Contact:

Re: BBC Basic for SDL 2.0 - VDU 23 command not working

Post by dv8 »

Tzap_Micro wrote: Fri Apr 12, 2024 8:38 am First screen is from beebem so I think program is ok?
By default BeebEm runs a Model B emulation. If you change it to Master emulation (Hardware > BBC Model > BBC Master 128) you will see the same effect as with BB4SDL.

On a Model B the font is 'imploded' by default, meaning there are only 32 UDGs, repeated across the 128-255 character range. On a Master and in BB4SDL the font is ' fully exploded', meaning every character can be redefined.

As JGH says above, your program is probably redefining characters in the 224-255 range, but is printing characters in the 128-159 range. With an 'imploded' font on the Model B this will repeat the defined characters, while an 'exploded' font will just show the original character definitions.

Try changing your VDU 23 statements to use characters 128-159:

VDU23,224,... becomes VDU23,128,...
VDU23,225,... becomes VDU23,129,...
etc.
Tzap_Micro
Posts: 6
Joined: Wed Mar 24, 2021 6:30 pm
Contact:

Re: BBC Basic for SDL 2.0 - VDU 23 command not working

Post by Tzap_Micro »

Great thanks for the help. Will try and report back in case others have a similar problem.
brianmartin_2001
Posts: 419
Joined: Mon Jun 14, 2021 7:39 pm
Contact:

Re: BBC Basic for SDL 2.0 - VDU 23 command not working

Post by brianmartin_2001 »

Will you post up your game/games when you fix it , screen shots look interesting.
Always good to see long time rare creations come into the light again.

Brian
Sysop of (the Night Owl BBS) nightowlbbs.ddns.net:6400
Post Reply

Return to “8-bit acorn emulators”